aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordlezcano <dlezcano>2008-10-24 20:11:25 +0000
committerdlezcano <dlezcano>2008-10-24 20:11:25 +0000
commit96c9f969b6a58f4fb616c0662d8d1e0f31453f40 (patch)
tree783e7ad1b3e795938c1dd83953b15aba5a118fca
parentremoved opentty now useless and fixed pid of root process for restart (diff)
downloadlxc-96c9f969b6a58f4fb616c0662d8d1e0f31453f40.tar.gz
lxc-96c9f969b6a58f4fb616c0662d8d1e0f31453f40.tar.bz2
lxc-96c9f969b6a58f4fb616c0662d8d1e0f31453f40.zip
Exit instead of returning in the child processes, otherwise the execution
path of the child will be wrong in case of error.
-rw-r--r--src/lxc/execute.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lxc/execute.c b/src/lxc/execute.c
index db4c872..95dc807 100644
--- a/src/lxc/execute.c
+++ b/src/lxc/execute.c
@@ -101,12 +101,12 @@ int lxc_execute(const char *name, int argc, char *argv[],
if (write(sv[0], &sync, sizeof(sync)) < 0) {
lxc_log_syserror("failed to write socket");
- return 1;
+ exit(1);
}
if (read(sv[0], &sync, sizeof(sync)) < 0) {
lxc_log_syserror("failed to read socket");
- return 1;
+ exit(1);
}
if (lxc_setup(name)) {
@@ -156,11 +156,11 @@ int lxc_execute(const char *name, int argc, char *argv[],
int status;
if (wait(&status) < 0) {
if (errno == ECHILD)
- return 0;
+ exit(0);
if (errno == EINTR)
continue;
lxc_log_syserror("failed to wait child");
- return 1;
+ exit(1);
}
}
}