diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-11-12 03:33:08 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-11-12 03:33:08 +0100 |
commit | 7af53310dd9154ba76be7808292d9a046b849e43 (patch) | |
tree | 75a49739917317234ac91edf0f7306326fadddf7 /src/utmp-wtmp.c | |
parent | 9d3e691e709eb12ce48a3dec6e50537406d12ad2 (diff) |
ask-password: don't show wall message on ttys we are already running a tty agent on
Diffstat (limited to 'src/utmp-wtmp.c')
-rw-r--r-- | src/utmp-wtmp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utmp-wtmp.c b/src/utmp-wtmp.c index 41589303ba..83da640bf3 100644 --- a/src/utmp-wtmp.c +++ b/src/utmp-wtmp.c @@ -358,7 +358,7 @@ finish: return r; } -int utmp_wall(const char *message) { +int utmp_wall(const char *message, bool (*match_tty)(const char *tty)) { struct utmpx *u; char date[FORMAT_TIMESTAMP_MAX]; char *text = NULL, *hn = NULL, *un = NULL, *tty = NULL; @@ -407,8 +407,9 @@ int utmp_wall(const char *message) { path = buf; } - if ((q = write_to_terminal(path, text)) < 0) - r = q; + if (!match_tty || match_tty(path)) + if ((q = write_to_terminal(path, text)) < 0) + r = q; free(buf); } |