]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Use SYSERROR instead of perror
authorTycho Andersen <tycho.andersen@canonical.com>
Fri, 3 Apr 2015 21:17:26 +0000 (21:17 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 10 Apr 2015 15:29:16 +0000 (11:29 -0400)
It is impolite to print stuff to stderror owned by other people, and they might
miss it anyway since it's not in the normal log location.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 9552ef369e71f0f8eb3d988c5c92248fc1e9b4a9..ca61e8accf533757a23a011bcd8c4e6993b2c23e 100644 (file)
@@ -4015,7 +4015,7 @@ static bool do_lxcapi_checkpoint(struct lxc_container *c, char *directory, bool
        } else {
                pid_t w = waitpid(pid, &status, 0);
                if (w == -1) {
-                       perror("waitpid");
+                       SYSERROR("waitpid");
                        return false;
                }
 
@@ -4136,7 +4136,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
 
                pid_t w = waitpid(pid, &status, 0);
                if (w == -1) {
-                       perror("waitpid");
+                       SYSERROR("waitpid");
                        goto out_fini_handler;
                }
 
@@ -4145,8 +4145,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
                pipe = -1;
 
                if (sizeof(status) != ret) {
-                       perror("write");
-                       ERROR("failed to write all of status");
+                       SYSERROR("failed to write all of status");
                        goto out_fini_handler;
                }
 
@@ -4157,8 +4156,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
                                int ret;
                                FILE *f = fopen(pidfile, "r");
                                if (!f) {
-                                       perror("reading pidfile");
-                                       ERROR("couldn't read restore's init pidfile %s\n", pidfile);
+                                       SYSERROR("couldn't read restore's init pidfile %s\n", pidfile);
                                        goto out_fini_handler;
                                }