From: Christian Brauner Date: Mon, 4 Dec 2017 00:41:49 +0000 (+0100) Subject: criu: initialize status X-Git-Tag: lxc-3.0.0.beta1~132^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=113ebd572991152e247ff0899a15d39335017242;p=thirdparty%2Flxc.git criu: initialize status Signed-off-by: Christian Brauner --- diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 96688edc0..3285176df 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -827,9 +827,10 @@ out_unlock: */ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_opts *opts, char *criu_version) { + int fd; pid_t pid; struct lxc_handler *handler; - int status, fd; + int status = 0; int pipes[2] = {-1, -1}; /* Try to detach from the current controlling tty if it exists. @@ -1049,9 +1050,9 @@ out: */ if (!status) status = 1; - if (write(status_pipe, &status, sizeof(status)) != sizeof(status)) { + + if (write(status_pipe, &status, sizeof(status)) != sizeof(status)) SYSERROR("writing status failed"); - } close(status_pipe); }