summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-27 05:30:58 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-27 05:30:58 +0100
commit2da3263ab6eed1780b000c09884ba9bf006c4891 (patch)
tree728c16a740bf8bb07c2670392c878486fcfd76aa /execute.c
parent1ea86b1803ed7bbb55b31bd9cb780a638a20b2a6 (diff)
fix an assert when forking
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/execute.c b/execute.c
index f3b4df930f..5def5ce1af 100644
--- a/execute.c
+++ b/execute.c
@@ -86,7 +86,7 @@ static int shift_fds(int fds[], unsigned n_fds) {
if ((nfd = fcntl(fds[i], F_DUPFD, i+3)) < 0)
return -errno;
- assert_se(close_nointr(fds[i]));
+ assert_se(close_nointr(fds[i]) == 0);
fds[i] = nfd;
/* Hmm, the fd we wanted isn't free? Then
@@ -112,7 +112,7 @@ int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds,
assert(ret);
assert(fds || n_fds <= 0);
- log_debug("About to execute %s", command->path);
+ log_debug("about to execute %s", command->path);
if ((pid = fork()) < 0)
return -errno;
@@ -193,6 +193,9 @@ int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds,
_exit(r);
}
+
+ log_debug("executed %s as %llu", command->path, (unsigned long long) pid);
+
*ret = pid;
return 0;
}