mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-31 17:17:43 +03:00
utmp: remove unneded parameters
With these functions no caller ever passes anything else than 0 for 't' (meaning the current time will be used).
This commit is contained in:
parent
4cbd9ecf45
commit
0ad26e09de
@ -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;
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -26,12 +26,12 @@
|
||||
|
||||
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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user