version 1.83, 2015/01/16 06:40:06 |
version 1.84, 2015/05/03 19:44:59 |
|
|
void |
void |
setfile(const char *name, int fd, struct stat *fs) |
setfile(const char *name, int fd, struct stat *fs) |
{ |
{ |
struct timeval tv[2]; |
struct timespec ts[2]; |
|
|
if (name == NULL || cat || testmode) |
if (name == NULL || cat || testmode) |
return; |
return; |
|
|
if (fs->st_flags && fchflags(fd, fs->st_flags)) |
if (fs->st_flags && fchflags(fd, fs->st_flags)) |
warn("fchflags: %s", name); |
warn("fchflags: %s", name); |
|
|
TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atimespec); |
ts[0] = fs->st_atim; |
TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtimespec); |
ts[1] = fs->st_mtim; |
if (futimes(fd, tv)) |
if (futimens(fd, ts)) |
warn("futimes: %s", name); |
warn("futimens: %s", name); |
} |
} |
|
|
int |
int |