[lxc-devel] [lxd/master] don't alias rsync error condition

tych0 on Github lxc-bot at linuxcontainers.org
Tue May 3 20:25:33 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 454 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160503/7354f887/attachment.bin>
-------------- next part --------------
From b78ac090a6b1e07994144dbf5c9b2e65321d2ae8 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Tue, 3 May 2016 20:20:44 +0000
Subject: [PATCH] don't alias rsync error condition

When rsyncing something, let's not mask err, so we can fail properly if the
rsync fails.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 lxd/rsync.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lxd/rsync.go b/lxd/rsync.go
index 9bc3b79..1d043df 100644
--- a/lxd/rsync.go
+++ b/lxd/rsync.go
@@ -141,7 +141,8 @@ func RsyncSend(path string, conn *websocket.Conn) error {
 		shared.Debugf("problem reading rsync stderr %s", err)
 	}
 
-	if err := cmd.Wait(); err != nil {
+	err = cmd.Wait()
+	if err != nil {
 		shared.Debugf("problem with rsync send of %s: %s: %s", path, err, string(output))
 	}
 


More information about the lxc-devel mailing list