Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
// monitor process. do_restore calls exit() if it fails.
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.
*/
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);
}