X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Frcvtty.c;h=69a903116fe56e9ed9633b962a56ada26fa756fa;hp=9eb365f161d98201757101716a69d061980541f0;hb=017a82124bf2ea39ced5aa4c8f969c18b3c2fb90;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/uip/rcvtty.c b/uip/rcvtty.c index 9eb365f..69a9031 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,7 @@ static struct swit switches[] = { #define VERSIONSW 8 { "version", 0 }, #define HELPSW 9 - { "help", 4 }, + { "help", 0 }, { NULL, 0 } }; @@ -167,6 +168,7 @@ main (int argc, char **argv) fclose (uf); exit (RCV_MOK); + return 0; /* dead code to satisfy the compiler */ } @@ -189,10 +191,14 @@ message_fd (char **vec) char tmpfil[BUFSIZ]; struct stat st; +#ifdef HAVE_MKSTEMP + fd = mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil))); +#else unlink (mktemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil)))); if ((fd = open (tmpfil, O_RDWR | O_CREAT | O_TRUNC, 0600)) == NOTOK) return header_fd (); unlink (tmpfil); +#endif if ((child_id = vfork()) == NOTOK) { /* fork error */ @@ -239,6 +245,7 @@ message_fd (char **vec) setpgid ((pid_t) 0, getpid ()); /* put in own process group */ execvp (vec[0], vec); _exit (-1); + return 1; /* dead code to satisfy compiler */ }