Skip to content
  • Junio C Hamano's avatar
    compat-util: is_missing_file_error() · dc5a18b3
    Junio C Hamano authored
    
    
    Our code often opens a path to an optional file, to work on its
    contents when we can successfully open it.  We can ignore a failure
    to open if such an optional file does not exist, but we do want to
    report a failure in opening for other reasons (e.g. we got an I/O
    error, or the file is there, but we lack the permission to open).
    
    The exact errors we need to ignore are ENOENT (obviously) and
    ENOTDIR (less obvious).  Instead of repeating comparison of errno
    with these two constants, introduce a helper function to do so.
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    dc5a18b3