Only use O_NOFOLLOW in utimensat if defined.

Fixes build on systems that don't have it (Solaris <=9)  Found by
Tom G. Christensen.
This commit is contained in:
Darren Tucker 2019-03-28 09:26:14 +11:00
parent 786cd4c183
commit f5abb05f8c
1 changed files with 2 additions and 0 deletions

View File

@ -143,8 +143,10 @@ utimensat(int fd, const char *path, const struct timespec times[2],
# ifndef HAVE_FUTIMES
return utimes(path, tv);
# else
# ifdef O_NOFOLLOW
if (flag & AT_SYMLINK_NOFOLLOW)
oflags |= O_NOFOLLOW;
# endif /* O_NOFOLLOW */
if ((fd = open(path, oflags)) == -1)
return -1;
ret = futimes(fd, tv);