Whamcloud - gitweb
LU-3835 hsm: add missing braces to ct_copy_attr() 62/7462/2
authorJohn L. Hammond <john.hammond@intel.com>
Tue, 27 Aug 2013 14:08:18 +0000 (09:08 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 30 Aug 2013 16:04:15 +0000 (16:04 +0000)
Add missing braces to ct_copy_attr() in lhsmtool_posix.c so that we
don't return a stale errno on success.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ia8ab377d8fd00d94666b15713f4e749d1330854a
Reviewed-on: http://review.whamcloud.com/7462
Tested-by: Hudson
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lhsmtool_posix.c

index c2b4df4..dd496f1 100644 (file)
@@ -714,10 +714,12 @@ static int ct_copy_attr(const char *src, const char *dst, int src_fd,
        times[1].tv_usec = 0;
        if (fchmod(dst_fd, st.st_mode) < 0 ||
            fchown(dst_fd, st.st_uid, st.st_gid) < 0 ||
-           futimes(dst_fd, times) < 0)
+           futimes(dst_fd, times) < 0) {
                CT_ERROR("'%s' fchmod fchown or futimes failed (%s)\n", src,
                         strerror(errno));
                return -errno;
+       }
+
        return 0;
 }