- int (*change_file_times) __P((const char *, const struct timeval *));
- int (*get_file_status) __P((const char *, struct stat *));
-
- setlocale(LC_ALL, "");
-
- aflag = cflag = fflag = hflag = mflag = timeset = 0;
- if (gettimeofday(&tv[0], NULL))
- err(1, "gettimeofday");
-
- while ((ch = getopt(argc, argv, "acfhmr:t:")) != -1)
+ char *myname;
+ struct attrlist ts_req = {
+ .bitmapcount = ATTR_BIT_MAP_COUNT,
+ .commonattr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME,
+ };
+ set_ts ts_struct = {};
+
+ myname = basename(argv[0]);
+ Aflag = aflag = cflag = fflag = mflag = timeset = 0;
+ stat_f = stat;
+ utimes_f = utimes;
+ if (clock_gettime(CLOCK_REALTIME, &ts_struct.mtime))
+ err(1, "clock_gettime");
+ ts_struct.atime = ts_struct.mtime;
+
+ while ((ch = getopt(argc, argv, "A:acfhmr:t:")) != -1)