]> git.marmaro.de Git - mmh/commitdiff
s/vfork/fork/
authormarkus schnalke <meillo@marmaro.de>
Tue, 3 Jan 2012 05:36:30 +0000 (06:36 +0100)
committermarkus schnalke <meillo@marmaro.de>
Tue, 3 Jan 2012 05:36:30 +0000 (06:36 +0100)
I truly believe that vfork is wrong. Forking should not be too slow for us.

14 files changed:
sbr/ext_hook.c
sbr/folder_delmsgs.c
sbr/makedir.c
sbr/refile.c
sbr/showfile.c
uip/mhbuildsbr.c
uip/mhlsbr.c
uip/mhparse.c
uip/mhshowsbr.c
uip/rcvtty.c
uip/replsbr.c
uip/sendsbr.c
uip/spost.c
uip/whatnowsbr.c

index 467718b0a25310cc681ca277f9f1125cc7466afe..771d5589cc86b615f5c2b18152f3b64d3de6767f 100644 (file)
@@ -22,7 +22,7 @@ ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2)
        if ((hook = context_find(hook_name)) == NULL)
                return (OK);
 
-       switch (pid = vfork()) {
+       switch (pid = fork()) {
        case -1:
                status = NOTOK;
                advise(NULL, "external database may be out-of-date.");
index 4950330a115d27309764785c8182ab5e1e3d35a7..d6e63b6ccc0c43ca98e9ddc3cbfa1d12f6b1beb2 100644 (file)
@@ -56,7 +56,7 @@ folder_delmsgs(struct msgs *mp, int unlink_msgs, int nohook)
                fflush(stdout);
                vec[0] = mhbasename(rmmproc);
 
-               switch (pid = vfork()) {
+               switch (pid = fork()) {
                case -1:
                        advise("fork", "unable to");
                        return -1;
index d5d536cef45e102164420e1a99567cad25ef9911..f064f773641092502dd1bb5d8fabdaa19fc8f3ad 100644 (file)
@@ -91,7 +91,7 @@ makedir(char *dir)
                ** directories like the above code can.
                ** -- Dan Harkless <dan-nmh@dilvish.speed.net>
                */
-               switch (pid = vfork()) {
+               switch (pid = fork()) {
                case -1:
                        advise("fork", "unable to");
                        return 0;
index 48f0b4441c66907b8e30f748226ffde0ade5733c..55ba754e8797729dfb18e7745da170da8d73e023 100644 (file)
@@ -33,7 +33,7 @@ refile(char **arg, char *file)
        context_save();  /* save the context file */
        fflush(stdout);
 
-       switch (pid = vfork()) {
+       switch (pid = fork()) {
        case -1:
                advise("fork", "unable to");
                return -1;
index 3f23801f076f16aac3e6c6f5504beb46107e4e7d..78eea645a24d1fea7a6078ceff37b981c0a1faa7 100644 (file)
@@ -27,7 +27,7 @@ showfile(char **arg, char *file)
        if (!strcmp(mhbasename(lproc), "mhl"))
                lproc = mhlproc;
 
-       switch (pid = vfork()) {
+       switch (pid = fork()) {
        case -1:
                /* fork error */
                advise("fork", "unable to");
index 873b0e3a8c2e5ca877daebe63ecd041939b4d0fa..05f1b35cdea1332df983d782e0e27ac17ab709e9 100644 (file)
@@ -1120,7 +1120,7 @@ raw:
                        if ((out = fopen(ce->ce_file, "w")) == NULL)
                                adios(ce->ce_file, "unable to open for writing");
 
-                       for (i = 0; (child_id = vfork()) == NOTOK && i > 5; i++)
+                       for (i = 0; (child_id = fork()) == NOTOK && i > 5; i++)
                                sleep(5);
                        switch (child_id) {
                        case NOTOK:
index 927d8454d462e961d224082800058db36094f562..1764aa5f1a9399b4d379999b399187a8507db1e9 100644 (file)
@@ -1527,7 +1527,7 @@ m_popen(char *name)
        if (pipe(pd) == NOTOK)
                adios("pipe", "unable to");
 
-       switch (m_pid = vfork()) {
+       switch (m_pid = fork()) {
        case NOTOK:
                adios("fork", "unable to");
 
index 95f89121045ecc589ae77049ce906db7456f2bf6..1ac7ea9a1f34767a170a6aff3e0c557582b1cced 100644 (file)
@@ -2609,7 +2609,7 @@ openFTP(CT ct, char **file)
 
                fflush(stdout);
 
-               for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+               for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                        sleep(5);
                switch (child_id) {
                case NOTOK:
@@ -2755,7 +2755,7 @@ openMail(CT ct, char **file)
        vec[vecp++] = e->eb_body;
        vec[vecp] = NULL;
 
-       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                sleep(5);
        switch (child_id) {
        case NOTOK:
index 0136ca32d13a542e5e26e789dac383ef6c9648a5..8fed651fa320c87db95365f4e14f91ece9ab8636 100644 (file)
@@ -220,7 +220,7 @@ DisplayMsgHeader(CT ct, char *form)
 
        fflush(stdout);
 
-       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                sleep(5);
 
        switch (child_id) {
@@ -602,7 +602,7 @@ show_content_aux2(CT ct, int serial, int alternate, char *cracked,
 
        fflush(stdout);
 
-       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                sleep(5);
        switch (child_id) {
        case NOTOK:
index a71a516ef20412d08881084340dd376eb992cd05..e1f5e9422feedf1c5426341a75c9d3848d743a32 100644 (file)
@@ -235,7 +235,7 @@ message_fd(char **vec)
 #endif
        unlink(tmpfil);
 
-       if ((child_id = vfork()) == NOTOK) {
+       if ((child_id = fork()) == NOTOK) {
                /* fork error */
                close(fd);
                return header_fd();
index b63d0134d8dcb71fcac55b91ee999434e6618cc3..2affe310d0b90af42f122b5a1a291b9c5bece35e 100644 (file)
@@ -441,7 +441,7 @@ replfilter(FILE *in, FILE *out, char *filter)
        rewind(in);
        lseek(fileno(in), (off_t) 0, SEEK_SET);
 
-       switch (pid = vfork()) {
+       switch (pid = fork()) {
        case NOTOK:
                adios("fork", "unable to");
 
index 42c2c21d32a5cacd84737a48a8a77e763016947c..de00429e936cb84615b70af666a712379a73b2d2 100644 (file)
@@ -597,7 +597,7 @@ sendaux(char **vec, int vecp, char *drft, struct stat *st)
                done(1);
        vec[vecp] = NULL;
 
-       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                sleep(5);
 
        switch (child_id) {
index cc163ac0b2fa672a72350163eb36a3f563bd5eec..8c55c06e63e96ad99550ac47a515ba8ea7e71fd5 100644 (file)
@@ -431,7 +431,7 @@ main(int argc, char **argv)
 
        if (pushflg && !(watch || verbose)) {
                /* fork to a child to run sendmail */
-               for (i=0; (pid = vfork()) == NOTOK && i < 5; i++)
+               for (i=0; (pid = fork()) == NOTOK && i < 5; i++)
                        sleep(5);
                switch (pid) {
                case NOTOK:
@@ -797,11 +797,11 @@ make_bcc_file(void)
        } else {
                vec[0] = mhbasename(mhlproc);
 
-               for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+               for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                        sleep(5);
                switch (child_id) {
                case NOTOK:
-                       adios("vfork", "unable to");
+                       adios("fork", "unable to");
 
                case OK:
                        dup2(fileno(out), 1);
@@ -857,7 +857,7 @@ fcc(char *file, char *folder)
                                folder);
        fflush(stdout);
 
-       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                sleep(5);
        switch (child_id) {
        case NOTOK:
index 82af31e8bf349e38a969892135b6c29978c44d95..ed5647efecc34ad55b5b3f491ae1c7a8c52c5bcb 100644 (file)
@@ -703,7 +703,7 @@ editfile(char **ed, char **arg, char *file, int use, struct msgs *mp,
        context_save();  /* save the context file */
        fflush(stdout);
 
-       switch (pid = vfork()) {
+       switch (pid = fork()) {
        case NOTOK:
                advise("fork", "unable to");
                status = NOTOK;
@@ -853,7 +853,7 @@ sendfile(char **arg, char *file, int pushsw)
        context_save();  /* save the context file */
        fflush(stdout);
 
-       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
                sleep(5);
        switch (child_id) {
        case NOTOK: