Commit 5a211571 by dlezcano

Fix forked process should exit instead of returning on error

parent 2a87f764
...@@ -121,6 +121,7 @@ int lxc_execute(const char *name, int argc, char *argv[], ...@@ -121,6 +121,7 @@ int lxc_execute(const char *name, int argc, char *argv[],
goto error; goto error;
} }
if (conf_has_network(name))
if (mount("sysfs", "/sys", "sysfs", 0, NULL)) { if (mount("sysfs", "/sys", "sysfs", 0, NULL)) {
lxc_log_syserror("failed to mount '/sys'"); lxc_log_syserror("failed to mount '/sys'");
/* continue: non fatal error until sysfs not per /* continue: non fatal error until sysfs not per
...@@ -134,12 +135,12 @@ int lxc_execute(const char *name, int argc, char *argv[], ...@@ -134,12 +135,12 @@ int lxc_execute(const char *name, int argc, char *argv[],
} }
execvp(argv[0], argv); execvp(argv[0], argv);
error:
lxc_log_syserror("failed to exec %s", argv[0]); lxc_log_syserror("failed to exec %s", argv[0]);
error:
if (write(sv[0], &sync, sizeof(sync)) < 0) if (write(sv[0], &sync, sizeof(sync)) < 0)
lxc_log_syserror("failed to write the socket"); lxc_log_syserror("failed to write the socket");
return 1; exit(1);
} }
setsid(); setsid();
......
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