X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fexecute.c;h=9ded1c77882cd3e5750f3f8cb348eedeb6ffbc3b;hp=d5bb8d3602920510e3fdb4e46db6a6d544f9b612;hb=daf32cc791f26e2a9849e25b94304839e20fcc3b;hpb=bb00e604097fba830af1dc078d78aff278dfcd37 diff --git a/src/execute.c b/src/execute.c index d5bb8d360..9ded1c778 100644 --- a/src/execute.c +++ b/src/execute.c @@ -970,11 +970,20 @@ int exec_spawn(ExecCommand *command, goto fail; } - if (socket_fd >= 0 && context->tcpwrap_name) - if (!socket_tcpwrap(socket_fd, context->tcpwrap_name)) { - r = EXIT_TCPWRAP; - goto fail; + if (context->tcpwrap_name) { + if (socket_fd >= 0) + if (!socket_tcpwrap(socket_fd, context->tcpwrap_name)) { + r = EXIT_TCPWRAP; + goto fail; + } + + for (i = 0; i < (int) n_fds; i++) { + if (!socket_tcpwrap(fds[i], context->tcpwrap_name)) { + r = EXIT_TCPWRAP; + goto fail; + } } + } if (confirm_spawn) { char response; @@ -1273,7 +1282,7 @@ int exec_spawn(ExecCommand *command, log_debug("Forked %s as %lu", command->path, (unsigned long) pid); command->exec_status.pid = pid; - command->exec_status.start_timestamp = now(CLOCK_REALTIME); + dual_timestamp_get(&command->exec_status.start_timestamp); *ret = pid; return 0; @@ -1553,7 +1562,7 @@ void exec_status_fill(ExecStatus *s, pid_t pid, int code, int status) { assert(s); s->pid = pid; - s->exit_timestamp = now(CLOCK_REALTIME); + dual_timestamp_get(&s->exit_timestamp); s->code = code; s->status = status; @@ -1575,17 +1584,17 @@ void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix) { "%sPID: %lu\n", prefix, (unsigned long) s->pid); - if (s->start_timestamp > 0) + if (s->start_timestamp.realtime > 0) fprintf(f, "%sStart Timestamp: %s\n", - prefix, format_timestamp(buf, sizeof(buf), s->start_timestamp)); + prefix, format_timestamp(buf, sizeof(buf), s->start_timestamp.realtime)); - if (s->exit_timestamp > 0) + if (s->exit_timestamp.realtime > 0) fprintf(f, "%sExit Timestamp: %s\n" "%sExit Code: %s\n" "%sExit Status: %i\n", - prefix, format_timestamp(buf, sizeof(buf), s->exit_timestamp), + prefix, format_timestamp(buf, sizeof(buf), s->exit_timestamp.realtime), prefix, sigchld_code_to_string(s->code), prefix, s->status); }