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.
This commit is contained in:
parent
5454df9c31
commit
826538bf64
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue