summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2017-08-10 14:41:51 +0300
committerDan McDonald <danmcd@joyent.com>2017-11-16 10:43:11 -0500
commitdfe02591ce4c15a40d7babbf85ceb4125485779d (patch)
tree61841485e875926156e773bdf1a7fe7797f00dac
parentd9e525a856d3050197717c45fb58667e0ee0f297 (diff)
downloadillumos-joyent-dfe02591ce4c15a40d7babbf85ceb4125485779d.tar.gz
8769 mv: variable 'rc' set but not used
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Gary Mills <gary_mills@fastmail.fm> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/mv/mv.c7
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);