]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: log lxc-user-nic output
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 24 Aug 2017 11:43:15 +0000 (13:43 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 29 Aug 2017 18:04:16 +0000 (14:04 -0400)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index af32d7abc1c6f2e752546d56f8a8c5115fa4a039..c5609ec4e5c4f21e8273cf57edd38767beacad22 100644 (file)
@@ -3226,14 +3226,19 @@ static int unpriv_assign_nic(const char *lxcpath, char *lxcname,
        close(pipefd[1]);
 
        bytes = read(pipefd[0], &buffer, MAX_BUFFER_SIZE);
-       if (bytes < 0)
+       if (bytes < 0) {
                SYSERROR("Failed to read from pipe file descriptor.");
+               close(pipefd[0]);
+               return -1;
+       }
        buffer[bytes - 1] = '\0';
 
        if (wait_for_pid(child) != 0) {
+               TRACE("lxc-user-nic failed to configure requested network");
                close(pipefd[0]);
                return -1;
        }
+       TRACE("Received output \"%s\" from lxc-user-nic", buffer);
 
        /* close the read-end of the pipe */
        close(pipefd[0]);