summaryrefslogtreecommitdiff
path: root/wrapper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-05-30 00:23:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-30 00:29:00 (GMT)
commitc7054209d65db430bdbcb2243288e63cea3e417c (patch)
tree215774833cded6430026ed7c88a646143223c28e /wrapper.c
parentdc5a18b3643553cacd6f1a3e4bff6a678b067055 (diff)
downloadgit-c7054209d65db430bdbcb2243288e63cea3e417c.zip
git-c7054209d65db430bdbcb2243288e63cea3e417c.tar.gz
git-c7054209d65db430bdbcb2243288e63cea3e417c.tar.bz2
treewide: use is_missing_file_error() where ENOENT and ENOTDIR are checked
Using the is_missing_file_error() helper introduced in the previous step, update all hits from $ git grep -e ENOENT --and -e ENOTDIR There are codepaths that only check ENOENT, and it is possible that some of them should be checking both. Updating them is kept out of this step deliberately, as we do not want to change behaviour in this step. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wrapper.c')
-rw-r--r--wrapper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wrapper.c b/wrapper.c
index 0542fc7..2fbbd81 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -583,8 +583,8 @@ void warn_on_inaccessible(const char *path)
static int access_error_is_ok(int err, unsigned flag)
{
- return err == ENOENT || err == ENOTDIR ||
- ((flag & ACCESS_EACCES_OK) && err == EACCES);
+ return (is_missing_file_error(err) ||
+ ((flag & ACCESS_EACCES_OK) && err == EACCES));
}
int access_or_warn(const char *path, int mode, unsigned flag)