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:
parent
786cd4c183
commit
f5abb05f8c
|
@ -143,8 +143,10 @@ utimensat(int fd, const char *path, const struct timespec times[2],
|
||||||
# ifndef HAVE_FUTIMES
|
# ifndef HAVE_FUTIMES
|
||||||
return utimes(path, tv);
|
return utimes(path, tv);
|
||||||
# else
|
# else
|
||||||
|
# ifdef O_NOFOLLOW
|
||||||
if (flag & AT_SYMLINK_NOFOLLOW)
|
if (flag & AT_SYMLINK_NOFOLLOW)
|
||||||
oflags |= O_NOFOLLOW;
|
oflags |= O_NOFOLLOW;
|
||||||
|
# endif /* O_NOFOLLOW */
|
||||||
if ((fd = open(path, oflags)) == -1)
|
if ((fd = open(path, oflags)) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
ret = futimes(fd, tv);
|
ret = futimes(fd, tv);
|
||||||
|
|
Loading…
Reference in New Issue