version 1.36, 2010/09/08 15:15:50 |
version 1.37, 2010/10/20 19:53:53 |
|
|
struct stat st; |
struct stat st; |
time_t mtime; |
time_t mtime; |
|
|
if (fstat(file->rf_fd, &st) == -1) { |
if (file->rf_file == NULL) |
|
return (-1); |
|
|
|
if (fstat(fileno(file->rf_file), &st) == -1) { |
warn("%s", file->rf_path); |
warn("%s", file->rf_path); |
return (-1); |
return (-1); |
} |
} |
|
|
{ |
{ |
static struct timeval tv[2]; |
static struct timeval tv[2]; |
|
|
if (mtime == -1) |
if (file->rf_file == NULL || mtime == -1) |
return; |
return; |
|
|
tv[0].tv_sec = mtime; |
tv[0].tv_sec = mtime; |
tv[1].tv_sec = tv[0].tv_sec; |
tv[1].tv_sec = tv[0].tv_sec; |
|
|
if (futimes(file->rf_fd, tv) == -1) |
if (futimes(fileno(file->rf_file), tv) == -1) |
err(1, "utimes"); |
err(1, "utimes"); |
} |
} |
|
|