From: David Levine Date: Fri, 13 Dec 2013 00:37:58 +0000 (-0600) Subject: Tweaked rcvtty.c to squelch warnings on OpenBSD. Three of the X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6443ed24f6c3b41186636a0b0fea93ebe9452047?ds=inline;hp=baa5cf8f7797dfa48f77f5d0813a9741d66be213 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. --- 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 */