Commit b75e9e23 by Tycho Andersen Committed by Stéphane Graber

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: 's avatarTycho Andersen <tycho.andersen@canonical.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent f3b94d24
...@@ -4015,7 +4015,7 @@ static bool do_lxcapi_checkpoint(struct lxc_container *c, char *directory, bool ...@@ -4015,7 +4015,7 @@ static bool do_lxcapi_checkpoint(struct lxc_container *c, char *directory, bool
} else { } else {
pid_t w = waitpid(pid, &status, 0); pid_t w = waitpid(pid, &status, 0);
if (w == -1) { if (w == -1) {
perror("waitpid"); SYSERROR("waitpid");
return false; return false;
} }
...@@ -4136,7 +4136,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool ...@@ -4136,7 +4136,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
pid_t w = waitpid(pid, &status, 0); pid_t w = waitpid(pid, &status, 0);
if (w == -1) { if (w == -1) {
perror("waitpid"); SYSERROR("waitpid");
goto out_fini_handler; goto out_fini_handler;
} }
...@@ -4145,8 +4145,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool ...@@ -4145,8 +4145,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
pipe = -1; pipe = -1;
if (sizeof(status) != ret) { if (sizeof(status) != ret) {
perror("write"); SYSERROR("failed to write all of status");
ERROR("failed to write all of status");
goto out_fini_handler; goto out_fini_handler;
} }
...@@ -4157,8 +4156,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool ...@@ -4157,8 +4156,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
int ret; int ret;
FILE *f = fopen(pidfile, "r"); FILE *f = fopen(pidfile, "r");
if (!f) { if (!f) {
perror("reading pidfile"); SYSERROR("couldn't read restore's init pidfile %s\n", pidfile);
ERROR("couldn't read restore's init pidfile %s\n", pidfile);
goto out_fini_handler; goto out_fini_handler;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment