]> diplodocus.org Git - nmh/commitdiff
Tweaked rcvtty.c to squelch warnings on OpenBSD. Three of the
authorDavid Levine <levinedl@acm.org>
Fri, 13 Dec 2013 00:37:58 +0000 (18:37 -0600)
committerDavid Levine <levinedl@acm.org>
Fri, 13 Dec 2013 00:37:58 +0000 (18:37 -0600)
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

index e91c74c21b6274cd1cea5aef41f08487853b43fc..356234adf3062a5f68ffb603412a76e233ecc9d2 100644 (file)
@@ -69,7 +69,9 @@ char *getusername(void);
 static void alrmser (int);
 static int message_fd (char **);
 static int header_fd (void);
 static void alrmser (int);
 static int message_fd (char **);
 static int header_fd (void);
+#if HAVE_GETUTXENT
 static void alert (char *, int);
 static void alert (char *, int);
+#endif /* HAVE_GETUTXENT */
 
 
 int
 
 
 int
@@ -164,6 +166,9 @@ main (int argc, char **argv)
         }
     }
     endutxent();
         }
     }
     endutxent();
+#else
+    NMH_UNUSED (tty);
+    NMH_UNUSED (utp);
 #endif /* HAVE_GETUTXENT */
 
     exit (RCV_MOK);
 #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 */
        _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)
 {
 static void
 alert (char *tty, int md)
 {
@@ -304,4 +313,4 @@ alert (char *tty, int md)
 
     close (td);
 }
 
     close (td);
 }
-
+#endif /* HAVE_GETUTXENT */