From 40821f5c1316e9205a08375e7075909cc9968e7d Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 3 Jan 2012 06:36:30 +0100 Subject: [PATCH] s/vfork/fork/ I truly believe that vfork is wrong. Forking should not be too slow for us. --- sbr/ext_hook.c | 2 +- sbr/folder_delmsgs.c | 2 +- sbr/makedir.c | 2 +- sbr/refile.c | 2 +- sbr/showfile.c | 2 +- uip/mhbuildsbr.c | 2 +- uip/mhlsbr.c | 2 +- uip/mhparse.c | 4 ++-- uip/mhshowsbr.c | 4 ++-- uip/rcvtty.c | 2 +- uip/replsbr.c | 2 +- uip/sendsbr.c | 2 +- uip/spost.c | 8 ++++---- uip/whatnowsbr.c | 4 ++-- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sbr/ext_hook.c b/sbr/ext_hook.c index 467718b..771d558 100644 --- a/sbr/ext_hook.c +++ b/sbr/ext_hook.c @@ -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."); diff --git a/sbr/folder_delmsgs.c b/sbr/folder_delmsgs.c index 4950330..d6e63b6 100644 --- a/sbr/folder_delmsgs.c +++ b/sbr/folder_delmsgs.c @@ -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; diff --git a/sbr/makedir.c b/sbr/makedir.c index d5d536c..f064f77 100644 --- a/sbr/makedir.c +++ b/sbr/makedir.c @@ -91,7 +91,7 @@ makedir(char *dir) ** directories like the above code can. ** -- Dan Harkless */ - switch (pid = vfork()) { + switch (pid = fork()) { case -1: advise("fork", "unable to"); return 0; diff --git a/sbr/refile.c b/sbr/refile.c index 48f0b44..55ba754 100644 --- a/sbr/refile.c +++ b/sbr/refile.c @@ -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; diff --git a/sbr/showfile.c b/sbr/showfile.c index 3f23801..78eea64 100644 --- a/sbr/showfile.c +++ b/sbr/showfile.c @@ -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"); diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 873b0e3..05f1b35 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -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: diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 927d845..1764aa5 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -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"); diff --git a/uip/mhparse.c b/uip/mhparse.c index 95f8912..1ac7ea9 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -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: diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 0136ca3..8fed651 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -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: diff --git a/uip/rcvtty.c b/uip/rcvtty.c index a71a516..e1f5e94 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -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(); diff --git a/uip/replsbr.c b/uip/replsbr.c index b63d013..2affe31 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -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"); diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 42c2c21..de00429 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -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) { diff --git a/uip/spost.c b/uip/spost.c index cc163ac..8c55c06 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -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: diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 82af31e..ed5647e 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -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: -- 1.7.10.4