]> 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)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 25 Aug 2017 04:35:54 +0000 (06:35 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 90e8bb02ff53cd9329446a1fd29811717a01995e..cf4cb3c9cc7ed05766bc9636f1e4e6b25278ca87 100644 (file)
@@ -3330,14 +3330,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]);