From: markus schnalke Date: Thu, 15 Jan 2015 19:30:15 +0000 (+0100) Subject: rmm: Use execprog() instead of own fork-exec X-Git-Tag: mmh-0.2-RC1~68 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=25e91f307475ef5b7e60b882299e0208398389c2;p=mmh rmm: Use execprog() instead of own fork-exec --- 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 ... */ }