criu: initialize status

parent 57d668df
...@@ -829,9 +829,10 @@ out_unlock: ...@@ -829,9 +829,10 @@ out_unlock:
*/ */
static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_opts *opts, char *criu_version) static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_opts *opts, char *criu_version)
{ {
int fd;
pid_t pid; pid_t pid;
struct lxc_handler *handler; struct lxc_handler *handler;
int status, fd; int status = 0;
int pipes[2] = {-1, -1}; int pipes[2] = {-1, -1};
/* Try to detach from the current controlling tty if it exists. /* Try to detach from the current controlling tty if it exists.
...@@ -1051,9 +1052,9 @@ out: ...@@ -1051,9 +1052,9 @@ out:
*/ */
if (!status) if (!status)
status = 1; status = 1;
if (write(status_pipe, &status, sizeof(status)) != sizeof(status)) {
if (write(status_pipe, &status, sizeof(status)) != sizeof(status))
SYSERROR("writing status failed"); SYSERROR("writing status failed");
}
close(status_pipe); close(status_pipe);
} }
......
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