}
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;
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));
}
}
#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;
}
}
#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;
}
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));
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;
}
-int utmp_put_runlevel(usec_t t, int runlevel, int previous) {
+int utmp_put_runlevel(int runlevel, int previous) {
struct utmpx store;
int r;
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);
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));