version 1.27, 2015/01/16 06:40:09 |
version 1.28, 2015/10/13 08:49:51 |
|
|
*/ |
*/ |
|
|
#include "rcv.h" |
#include "rcv.h" |
|
#include <fcntl.h> |
#include "extern.h" |
#include "extern.h" |
|
|
/* |
/* |
|
|
void |
void |
alter(char *name) |
alter(char *name) |
{ |
{ |
struct stat sb; |
struct timespec ts[2]; |
struct timeval tv[2]; |
|
|
|
if (stat(name, &sb)) |
clock_gettime(CLOCK_REALTIME, &ts[0]); |
return; |
ts[0].tv_sec++; |
(void) gettimeofday(&tv[0], (struct timezone *)0); |
ts[1].tv_nsec = UTIME_OMIT; |
tv[0].tv_sec++; |
(void)utimensat(AT_FDCWD, name, ts, 0); |
#ifdef TIMESPEC_TO_TIMEVAL |
|
TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec); |
|
#else |
|
tv[1].tv_sec = sb.st_mtime; |
|
#endif |
|
(void)utimes(name, tv); |
|
} |
} |
|
|
/* |
/* |