diff options
-rw-r--r-- | usr/src/cmd/mv/mv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/src/cmd/mv/mv.c b/usr/src/cmd/mv/mv.c index c82887a807..e53023df95 100644 --- a/usr/src/cmd/mv/mv.c +++ b/usr/src/cmd/mv/mv.c @@ -1354,14 +1354,16 @@ static int chg_time(char *to, struct stat ss) { struct timespec times[2]; +#ifdef XPG4 int rc; +#endif times[0] = ss.st_atim; times[1] = ss.st_mtim; +#ifdef XPG4 rc = utimensat(AT_FDCWD, to, times, ISLNK(s1) ? AT_SYMLINK_NOFOLLOW : 0); -#ifdef XPG4 if ((pflg || mve) && rc != 0) { (void) fprintf(stderr, gettext("%s: cannot set times for %s: "), cmd, to); @@ -1369,6 +1371,9 @@ chg_time(char *to, struct stat ss) if (pflg) return (1); } +#else + (void) utimensat(AT_FDCWD, to, times, + ISLNK(s1) ? AT_SYMLINK_NOFOLLOW : 0); #endif return (0); |