chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ea86b1
)
fix an assert when forking
author
Lennart Poettering
<lennart@poettering.net>
Wed, 27 Jan 2010 04:30:58 +0000
(
05:30
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 27 Jan 2010 04:30:58 +0000
(
05:30
+0100)
execute.c
patch
|
blob
|
history
diff --git
a/execute.c
b/execute.c
index f3b4df930f24f8a768d3b7150c65573efc33f541..5def5ce1af5c8a553867168d9721ff3a1510852e 100644
(file)
--- 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;
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
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);
assert(ret);
assert(fds || n_fds <= 0);
- log_debug("
A
bout to execute %s", command->path);
+ log_debug("
a
bout to execute %s", command->path);
if ((pid = fork()) < 0)
return -errno;
if ((pid = fork()) < 0)
return -errno;
@@
-193,6
+193,9
@@
int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds,
_exit(r);
}
_exit(r);
}
+
+ log_debug("executed %s as %llu", command->path, (unsigned long long) pid);
+
*ret = pid;
return 0;
}
*ret = pid;
return 0;
}