chiark / gitweb /
utmp: remove unneded parameters
authorMichal Schmidt <mschmidt@redhat.com>
Sun, 6 Nov 2011 22:06:38 +0000 (23:06 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Mon, 7 Nov 2011 00:09:53 +0000 (01:09 +0100)
With these functions no caller ever passes anything else than 0
for 't' (meaning the current time will be used).

src/execute.c
src/systemctl.c
src/update-utmp.c
src/utmp-wtmp.c
src/utmp-wtmp.h

index 866e8bf2f69ed9e088e47dea5afd3eebff44d851..250d53a424a07655929439929a62a56d6eec99c0 100644 (file)
@@ -1170,7 +1170,7 @@ int exec_spawn(ExecCommand *command,
                         }
 
                 if (context->utmp_id)
-                        utmp_put_init_process(0, context->utmp_id, getpid(), getsid(0), context->tty_path);
+                        utmp_put_init_process(context->utmp_id, getpid(), getsid(0), context->tty_path);
 
                 if (context->user) {
                         username = context->user;
index 175159d68fb42fc87380d72263d198bc9f3eadeb..7373e64e8c24c53011694634e01e767fc3136569 100644 (file)
@@ -5156,7 +5156,7 @@ static int halt_main(DBusConnection *bus) {
         if (!arg_no_wtmp) {
                 if (sd_booted() > 0)
                         log_debug("Not writing utmp record, assuming that systemd-update-utmp is used.");
-                else if ((r = utmp_put_shutdown(0)) < 0)
+                else if ((r = utmp_put_shutdown()) < 0)
                         log_warning("Failed to write utmp record: %s", strerror(-r));
         }
 
index 12e4d110425c2050f09edb7e14a5a581b7ee2ec7..073f28e2544478ffb6cadeece26e67bad977102b 100644 (file)
@@ -284,7 +284,7 @@ static int on_shutdown(Context *c) {
                 }
 #endif
 
-        if ((q = utmp_put_shutdown(0)) < 0) {
+        if ((q = utmp_put_shutdown()) < 0) {
                 log_error("Failed to write utmp record: %s", strerror(-q));
                 r = q;
         }
@@ -339,7 +339,7 @@ static int on_runlevel(Context *c) {
         }
 #endif
 
-        if ((q = utmp_put_runlevel(0, runlevel, previous)) < 0) {
+        if ((q = utmp_put_runlevel(runlevel, previous)) < 0) {
                 log_error("Failed to write utmp record: %s", strerror(-q));
                 r = q;
         }
index b03a3e70af9dbf8180a78763a420a6de5dcd6d92..e7b2e3cd9f1828c7a514e41efe494c09650c53ab 100644 (file)
@@ -172,10 +172,10 @@ static int write_entry_both(const struct utmpx *store) {
         return r;
 }
 
-int utmp_put_shutdown(usec_t t) {
+int utmp_put_shutdown(void) {
         struct utmpx store;
 
-        init_entry(&store, t);
+        init_entry(&store, 0);
 
         store.ut_type = RUN_LVL;
         strncpy(store.ut_user, "shutdown", sizeof(store.ut_user));
@@ -206,12 +206,12 @@ static const char *sanitize_id(const char *id) {
         return id + l - sizeof(((struct utmpx*) NULL)->ut_id);
 }
 
-int utmp_put_init_process(usec_t t, const char *id, pid_t pid, pid_t sid, const char *line) {
+int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line) {
         struct utmpx store;
 
         assert(id);
 
-        init_timestamp(&store, t);
+        init_timestamp(&store, 0);
 
         store.ut_type = INIT_PROCESS;
         store.ut_pid = pid;
@@ -257,7 +257,7 @@ int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
 }
 
 
-int utmp_put_runlevel(usec_t t, int runlevel, int previous) {
+int utmp_put_runlevel(int runlevel, int previous) {
         struct utmpx store;
         int r;
 
@@ -277,7 +277,7 @@ int utmp_put_runlevel(usec_t t, int runlevel, int previous) {
         if (previous == runlevel)
                 return 0;
 
-        init_entry(&store, t);
+        init_entry(&store, 0);
 
         store.ut_type = RUN_LVL;
         store.ut_pid = (runlevel & 0xFF) | ((previous & 0xFF) << 8);
index 4054aff7eafa7f38807c8bf6bdce845864720eb7..a5998ebb21105f5c26bb893918c625f499bcc131 100644 (file)
 
 int utmp_get_runlevel(int *runlevel, int *previous);
 
-int utmp_put_shutdown(usec_t timestamp);
+int utmp_put_shutdown(void);
 int utmp_put_reboot(usec_t timestamp);
-int utmp_put_runlevel(usec_t timestamp, int runlevel, int previous);
+int utmp_put_runlevel(int runlevel, int previous);
 
 int utmp_put_dead_process(const char *id, pid_t pid, int code, int status);
-int utmp_put_init_process(usec_t timestamp, const char *id, pid_t pid, pid_t sid, const char *line);
+int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line);
 
 int utmp_wall(const char *message, bool (*match_tty)(const char *tty));