From dfe02591ce4c15a40d7babbf85ceb4125485779d Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 10 Aug 2017 14:41:51 +0300 Subject: 8769 mv: variable 'rc' set but not used Reviewed by: Andrew Stormont Reviewed by: Gary Mills Approved by: Dan McDonald --- usr/src/cmd/mv/mv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3