#include "strv.h"
#include "macro.h"
#include "util.h"
+#include "log.h"
static int close_fds(int except[], unsigned n_except) {
DIR *d;
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
assert(ret);
assert(fds || n_fds <= 0);
+ log_debug("about to execute %s", command->path);
+
if ((pid = fork()) < 0)
return -errno;
_exit(r);
}
+
+ log_debug("executed %s as %llu", command->path, (unsigned long long) pid);
+
*ret = pid;
return 0;
}
}
}
-
void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
assert(c);
assert(f);
assert(c);
assert(c->argv);
- k = 0;
+ k = 1;
STRV_FOREACH(a, c->argv)
k += strlen(*a)+3;
}
+ *p = 0;
+
/* FIXME: this doesn't really handle arguments that have
* spaces and ticks in them */