From: Tycho Andersen Date: Fri, 3 Apr 2015 21:17:26 +0000 (+0000) Subject: Use SYSERROR instead of perror X-Git-Tag: lxc-2.0.0.beta1~324 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fdf4a73a25b5311af8dd7b8812f68d312ce566a;p=thirdparty%2Flxc.git Use SYSERROR instead of perror 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 Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 6ce518537..4762b1354 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -4018,7 +4018,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; } @@ -4139,7 +4139,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; } @@ -4148,8 +4148,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; } @@ -4160,8 +4159,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; }