Move #include from h/mh.h to source files
[mmh] / uip / rmm.c
index 9401d2b..520ce03 100644 (file)
--- a/uip/rmm.c
+++ b/uip/rmm.c
@@ -8,6 +8,8 @@
 
 #include <h/mh.h>
 #include <h/utils.h>
+#include <unistd.h>
+#include <locale.h>
 
 static struct swit switches[] = {
 #define UNLINKSW  0
@@ -31,7 +33,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]);
@@ -141,20 +142,5 @@ main(int argc, char **argv)
        }
        vec[vecp] = NULL;
 
-       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);
-       }
-
-       return 0;
+       return execprog(*vec, vec);
 }