chiark / gitweb /
man: document socket units
[elogind.git] / src / execute.c
index ed10ea2bfb20c2b6724f3463159eff8dafed2057..cf71f232b421635c7705d019c2b3b788bef47f70 100644 (file)
@@ -1213,7 +1213,7 @@ int exec_spawn(ExecCommand *command,
                 }
 
                 if (n_fds > 0)
-                        if (asprintf(our_env + n_env++, "LISTEN_PID=%llu", (unsigned long long) getpid()) < 0 ||
+                        if (asprintf(our_env + n_env++, "LISTEN_PID=%lu", (unsigned long) getpid()) < 0 ||
                             asprintf(our_env + n_env++, "LISTEN_FDS=%u", n_fds) < 0) {
                                 r = EXIT_MEMORY;
                                 goto fail;
@@ -1270,10 +1270,10 @@ int exec_spawn(ExecCommand *command,
         if (cgroup_bondings)
                 cgroup_bonding_install_list(cgroup_bondings, pid);
 
-        log_debug("Forked %s as %llu", command->path, (unsigned long long) pid);
+        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;
@@ -1517,9 +1517,9 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
         }
 
         if (c->user)
-                fprintf(f, "%sUser: %s", prefix, c->user);
+                fprintf(f, "%sUser: %s\n", prefix, c->user);
         if (c->group)
-                fprintf(f, "%sGroup: %s", prefix, c->group);
+                fprintf(f, "%sGroup: %s\n", prefix, c->group);
 
         if (strv_length(c->supplementary_groups) > 0) {
                 fprintf(f, "%sSupplementaryGroups:", prefix);
@@ -1528,7 +1528,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
         }
 
         if (c->pam_name)
-                fprintf(f, "%sPAMName: %s", prefix, c->pam_name);
+                fprintf(f, "%sPAMName: %s\n", prefix, c->pam_name);
 
         if (strv_length(c->read_write_dirs) > 0) {
                 fprintf(f, "%sReadWriteDirs:", prefix);
@@ -1553,7 +1553,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;
@@ -1572,20 +1572,20 @@ void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix) {
                 return;
 
         fprintf(f,
-                "%sPID: %llu\n",
-                prefix, (unsigned long long) s->pid);
+                "%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);
 }