Lines 62-67
Link Here
|
62 |
static void stime_arg2(const char *, int, struct timespec *); |
62 |
static void stime_arg2(const char *, int, struct timespec *); |
63 |
static void stime_darg(const char *, struct timespec *); |
63 |
static void stime_darg(const char *, struct timespec *); |
64 |
static void stime_file(const char *, struct timespec *); |
64 |
static void stime_file(const char *, struct timespec *); |
|
|
65 |
static void lstime_file(const char *, struct timespec *); |
65 |
static int timeoffset(const char *); |
66 |
static int timeoffset(const char *); |
66 |
static void usage(const char *); |
67 |
static void usage(const char *); |
67 |
|
68 |
|
Lines 81-87
Link Here
|
81 |
ts[0].tv_sec = ts[1].tv_sec = 0; |
82 |
ts[0].tv_sec = ts[1].tv_sec = 0; |
82 |
ts[0].tv_nsec = ts[1].tv_nsec = UTIME_NOW; |
83 |
ts[0].tv_nsec = ts[1].tv_nsec = UTIME_NOW; |
83 |
|
84 |
|
84 |
while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1) |
85 |
while ((ch = getopt(argc, argv, "A:acd:fhmr:R:t:")) != -1) |
85 |
switch(ch) { |
86 |
switch(ch) { |
86 |
case 'A': |
87 |
case 'A': |
87 |
Aflag = timeoffset(optarg); |
88 |
Aflag = timeoffset(optarg); |
Lines 110-115
Link Here
|
110 |
timeset = 1; |
111 |
timeset = 1; |
111 |
stime_file(optarg, ts); |
112 |
stime_file(optarg, ts); |
112 |
break; |
113 |
break; |
|
|
114 |
case 'R': |
115 |
timeset = 1; |
116 |
lstime_file(optarg, ts); |
117 |
break; |
113 |
case 't': |
118 |
case 't': |
114 |
timeset = 1; |
119 |
timeset = 1; |
115 |
stime_arg1(optarg, ts); |
120 |
stime_arg1(optarg, ts); |
Lines 396-405
Link Here
|
396 |
} |
401 |
} |
397 |
|
402 |
|
398 |
static void |
403 |
static void |
|
|
404 |
lstime_file(const char *fname, struct timespec *tsp) |
405 |
{ |
406 |
struct stat sb; |
407 |
|
408 |
if (lstat(fname, &sb)) |
409 |
err(1, "%s", fname); |
410 |
tsp[0] = sb.st_atim; |
411 |
tsp[1] = sb.st_mtim; |
412 |
} |
413 |
|
414 |
static void |
399 |
usage(const char *myname) |
415 |
usage(const char *myname) |
400 |
{ |
416 |
{ |
401 |
fprintf(stderr, "usage: %s [-A [-][[hh]mm]SS] [-achm] [-r file] " |
417 |
fprintf(stderr, "usage: %s [-A [-][[hh]mm]SS] [-achm] [-r file] " |
402 |
"[-t [[CC]YY]MMDDhhmm[.SS]]\n" |
418 |
"[-R file]\n" |
|
|
419 |
" [-t [[CC]YY]MMDDhhmm[.SS]]\n" |
403 |
" [-d YYYY-MM-DDThh:mm:SS[.frac][tz]] " |
420 |
" [-d YYYY-MM-DDThh:mm:SS[.frac][tz]] " |
404 |
"file ...\n", myname); |
421 |
"file ...\n", myname); |
405 |
exit(1); |
422 |
exit(1); |