X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/55f65ae2d3baf60396d3359db952460939de03ca..a8bb0c0d8fcfa7f5b43dee30ccfdf799bbbf8520:/uip/rcvtty.c?ds=sidebyside diff --git a/uip/rcvtty.c b/uip/rcvtty.c index e9163ba7..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,10 +166,12 @@ main (int argc, char **argv) } } endutxent(); +#else + NMH_UNUSED (tty); + NMH_UNUSED (utp); #endif /* HAVE_GETUTXENT */ exit (RCV_MOK); - return 0; /* dead code to satisfy the compiler */ } @@ -184,7 +188,9 @@ static int message_fd (char **vec) { pid_t child_id; - int bytes, fd, seconds; + int bytes, seconds; + /* volatile to prevent "might be clobbered" warning from gcc: */ + volatile int fd; char tmpfil[BUFSIZ]; struct stat st; @@ -234,9 +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); - return 1; /* dead code to satisfy compiler */ + 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 */