From 99f710dde855f7ecb699ddac6ad77923c1f6bc85 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Fri, 24 Apr 2015 15:31:29 +0200 Subject: 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. --- src/tty-ask-password-agent/tty-ask-password-agent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tty-ask-password-agent') diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 8cd6cabb18..c440170f95 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -381,7 +381,7 @@ static int wall_tty_block(void) { return fd; } -static bool wall_tty_match(const char *path) { +static bool wall_tty_match(const char *path, void *userdata) { int fd, r; struct stat st; _cleanup_free_ char *p = NULL; @@ -455,7 +455,7 @@ static int show_passwords(void) { r = q; if (wall) - utmp_wall(wall, NULL, wall_tty_match); + utmp_wall(wall, NULL, NULL, wall_tty_match, NULL); } return r; -- cgit v1.2.3-54-g00ecf