From 25e91f307475ef5b7e60b882299e0208398389c2 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Thu, 15 Jan 2015 20:30:15 +0100 Subject: [PATCH] rmm: Use execprog() instead of own fork-exec --- uip/rmm.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/uip/rmm.c b/uip/rmm.c index f602641..33ae9da 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -31,7 +31,6 @@ main(int argc, char **argv) char **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; - pid_t pid; setlocale(LC_ALL, ""); invo_name = mhbasename(argv[0]); @@ -140,22 +139,7 @@ main(int argc, char **argv) vec[vecp++] = msgs.msgs[msgnum]; } vec[vecp] = NULL; + done(execprog(*vec, vec)); - fflush(stdout); - switch (pid = fork()) { - case -1: - adios("fork", "unable to"); - - case 0: - execvp(*vec, vec); - fprintf(stderr, "unable to exec "); - perror(*vec); - _exit(-1); - - default: - pidwait(pid, -1); - } - - done(0); - return 1; + return 1; /* just in case ... */ } -- 1.7.10.4