From: G.raud Meyer Date: Mon, 9 Apr 2018 13:35:40 +0000 (+0200) Subject: rename: skip faccessat() failure if AT_SYMLINK_NOFOLLOW is not a valid flag X-Git-Tag: v2.33-rc1~309^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=826538bf64c5;p=thirdparty%2Futil-linux.git rename: skip faccessat() failure if AT_SYMLINK_NOFOLLOW is not a valid flag AT_SYMLINK_NOFOLLOW is not required by POSIX and it is not a valid flag on Mac OSX. --- diff --git a/misc-utils/rename.c b/misc-utils/rename.c index 9983ad2a9d..8f5d41a695 100644 --- a/misc-utils/rename.c +++ b/misc-utils/rename.c @@ -60,7 +60,11 @@ static int do_symlink(char *from, char *to, char *s, int verbose, int noact, int int ret = 1; struct stat sb; - if (faccessat(AT_FDCWD, s, F_OK, AT_SYMLINK_NOFOLLOW) != 0) { + if ( faccessat(AT_FDCWD, s, F_OK, AT_SYMLINK_NOFOLLOW) != 0 && + errno != EINVAL ) + /* Skip if AT_SYMLINK_NOFOLLOW is not supported; lstat() below will + detect the access error */ + { warn(_("%s: not accessible"), s); return 2; }