X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffdutimensat.c;h=51f0baa46bcc5a1d3ff6b4e17c5c9d5b4bd9502c;hb=387c96fc38b1985d677a25881ab99a449a00af22;hp=e49f82398157e09ed41d80cdd9f9cf5676227ee9;hpb=06b8c126a964a60ad353cc4f7b296060ae5c9df4;p=gnulib.git diff --git a/lib/fdutimensat.c b/lib/fdutimensat.c index e49f82398..51f0baa46 100644 --- a/lib/fdutimensat.c +++ b/lib/fdutimensat.c @@ -1,6 +1,6 @@ /* Set file access and modification times. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -35,16 +35,19 @@ use just futimes (or equivalent) instead of utimes (or equivalent), and fail if on an old system without futimes (or equivalent). If TIMESPEC is null, set the time stamps to the current time. + ATFLAG is passed to utimensat if FD is negative or futimens was + unsupported, which can allow operation on FILE as a symlink. Return 0 on success, -1 (setting errno) on failure. */ int -fdutimensat (int dir, char const *file, int fd, struct timespec const ts[2]) +fdutimensat (int fd, int dir, char const *file, struct timespec const ts[2], + int atflag) { int result = 1; if (0 <= fd) result = futimens (fd, ts); if (file && (fd < 0 || (result == -1 && errno == ENOSYS))) - result = utimensat (dir, file, ts, 0); + result = utimensat (dir, file, ts, atflag); if (result == 1) { errno = EBADF;