shared/utmp-wtmp: add parameter for origin tty and callback userdata
Instead of looking up the tty from STDIN, let utmp_wall() take an argument to specify an origin tty for the wall message. Only if that argument is NULL do the STDIN lookup. Also add an void *userdata argument that is handed back to the callback function.
This commit is contained in:
@@ -251,7 +251,7 @@ static void warn_wall(enum action a) {
|
||||
}
|
||||
|
||||
if (*p) {
|
||||
utmp_wall(p, NULL, NULL);
|
||||
utmp_wall(p, NULL, NULL, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,7 @@ static void warn_wall(enum action a) {
|
||||
if (!table[a])
|
||||
return;
|
||||
|
||||
utmp_wall(table[a], NULL, NULL);
|
||||
utmp_wall(table[a], NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static bool avoid_bus(void) {
|
||||
|
||||
Reference in New Issue
Block a user