From c0c74f8064392598cd29401142804fcc241841ed Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 17 Aug 2007 10:52:19 -0400 Subject: a few fixes for peer cred stuff --- tools/ck-get-x11-display-device.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tools/ck-get-x11-display-device.c') diff --git a/tools/ck-get-x11-display-device.c b/tools/ck-get-x11-display-device.c index 723d239..b349cc7 100644 --- a/tools/ck-get-x11-display-device.c +++ b/tools/ck-get-x11-display-device.c @@ -25,9 +25,6 @@ #include #include -#include -#include -#include #include #include @@ -116,10 +113,12 @@ main (int argc, ret = 0; res = ck_get_socket_peer_credentials (fd, &pid, NULL, NULL); if (res) { - device = get_tty_for_pid (pid); - if (device != NULL) { - printf ("%s\n", device); - g_free (device); + if (pid > 0) { + device = get_tty_for_pid (pid); + if (device != NULL) { + printf ("%s\n", device); + g_free (device); + } } } } -- cgit