From 6443ed24f6c3b41186636a0b0fea93ebe9452047 Mon Sep 17 00:00:00 2001 From: David Levine Date: Thu, 12 Dec 2013 18:37:58 -0600 Subject: [PATCH] Tweaked rcvtty.c to squelch warnings on OpenBSD. Three of the four were due to unused artifacts with HAVE_GETUTXENT not defined. The fourth was due to control reaching the end of non-void function message_id(), which had an _exit() call at the end. --- uip/rcvtty.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/uip/rcvtty.c b/uip/rcvtty.c index e91c74c2..356234ad 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -69,7 +69,9 @@ char *getusername(void); static void alrmser (int); static int message_fd (char **); static int header_fd (void); +#if HAVE_GETUTXENT static void alert (char *, int); +#endif /* HAVE_GETUTXENT */ int @@ -164,6 +166,9 @@ main (int argc, char **argv) } } endutxent(); +#else + NMH_UNUSED (tty); + NMH_UNUSED (utp); #endif /* HAVE_GETUTXENT */ exit (RCV_MOK); @@ -235,8 +240,11 @@ message_fd (char **vec) _exit (-1); closefds (3); setpgid ((pid_t) 0, getpid ()); /* put in own process group */ - execvp (vec[0], vec); - _exit (-1); + if (execvp (vec[0], vec) == NOTOK) { + _exit (-1); + } + + return NOTOK; } @@ -267,6 +275,7 @@ header_fd (void) } +#if HAVE_GETUTXENT static void alert (char *tty, int md) { @@ -304,4 +313,4 @@ alert (char *tty, int md) close (td); } - +#endif /* HAVE_GETUTXENT */ -- 2.56.0