]> diplodocus.org Git - nmh/commitdiff
Replace `_exit(-1)' with `_exit(1)'.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 18 Sep 2017 14:04:07 +0000 (15:04 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 18 Sep 2017 14:04:07 +0000 (15:04 +0100)
In line with other changes to limit a process's exit value to small
non-negative integers distinguishable with sh's `$?'.

18 files changed:
mts/smtp/smtp.c
sbr/ext_hook.c
sbr/folder_delmsgs.c
sbr/m_popen.c
sbr/refile.c
sbr/showfile.c
uip/forw.c
uip/mhbuildsbr.c
uip/mhn.c
uip/mhparse.c
uip/mhshowsbr.c
uip/post.c
uip/rcvtty.c
uip/replsbr.c
uip/sendsbr.c
uip/slocal.c
uip/whatnowsbr.c
uip/whom.c

index 2f57483..c7d9507 100644 (file)
@@ -339,7 +339,7 @@ sendmail_init (char *client, int watch, int verbose, int debug, int sasl,
            execvp (sendmail, vec);
            fprintf (stderr, "unable to exec ");
            perror (sendmail);
-           _exit (-1);         /* NOTREACHED */
+           _exit(1);           /* NOTREACHED */
 
        default: 
            SIGNAL (SIGPIPE, SIG_IGN);
index f1a9a14..ac88ac7 100644 (file)
@@ -38,7 +38,7 @@ ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2)
        vec[vecp++] = NULL;
        execvp(program, vec);
        advise(program, "Unable to execute");
-       _exit(-1);
+       _exit(1);
        /* NOTREACHED */
 
     default:
index 78fc516..9addf7c 100644 (file)
@@ -75,7 +75,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook)
            execvp (prog, vec);
            fprintf (stderr, "unable to exec ");
            perror (rmmproc);
-           _exit (-1);
+           _exit(1);
 
        default:
            arglist_free(prog, vec);
index 1fb0cfb..9a1c1a5 100644 (file)
@@ -47,7 +47,7 @@ m_popen (char *name, int savestdout)
            execvp (file, arglist);
            fprintf (stderr, "unable to exec ");
            perror (name);
-           _exit (-1);
+           _exit(1);
 
        default: 
            close (pd[0]);
index ade07f6..3c4d4e2 100644 (file)
@@ -43,7 +43,7 @@ refile (char **arg, char *file)
            execvp (program, vec);
            fprintf (stderr, "unable to exec ");
            perror (fileproc);
-           _exit (-1);
+           _exit(1);
 
        default: 
            arglist_free(program, vec);
index 9b24ec6..9dfda7b 100644 (file)
@@ -54,7 +54,7 @@ showfile (char **arg, char *file)
        execvp (program, vec);
        fprintf (stderr, "unable to exec ");
        perror (lproc);
-       _exit (-1);
+       _exit(1);
 
     default:
        /* parent */
index ce8a4fc..51caa0b 100644 (file)
@@ -540,7 +540,7 @@ mhl_draft (int out, char *digest, int volume, int issue,
            execvp (program, vec.msgs);
            fprintf (stderr, "unable to exec ");
            perror (mhlproc);
-           _exit (-1);
+           _exit(1);
 
        default: 
            close (pd[1]);
index 3ae8edc..ffec2d6 100644 (file)
@@ -1334,7 +1334,7 @@ raw:
                execvp ("/bin/sh", vec);
                fprintf (stderr, "unable to exec ");
                perror ("/bin/sh");
-               _exit (-1);
+               _exit(1);
                /* NOTREACHED */
 
            default:
index 4a3b33a..7103488 100644 (file)
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -370,7 +370,7 @@ do_cache:
 
        execvp ("mhbuild", vec);
        fprintf (stderr, "unable to exec ");
-       _exit (-1);
+       _exit(1);
     }
 
     /*
@@ -397,7 +397,7 @@ do_cache:
 
        execvp ("mhbuild", vec);
        fprintf (stderr, "unable to exec ");
-       _exit (-1);
+       _exit(1);
     }
 
     if (file && msgs.size)
index 1b2d23f..c49d31f 100644 (file)
@@ -2583,7 +2583,7 @@ openFTP (CT ct, char **file)
                execvp (ftp, vec);
                fprintf (stderr, "unable to exec ");
                perror (ftp);
-               _exit (-1);
+               _exit(1);
                /* NOTREACHED */
 
            default:
@@ -2716,7 +2716,7 @@ openMail (CT ct, char **file)
            execvp (mailproc, vec);
            fprintf (stderr, "unable to exec ");
            perror (mailproc);
-           _exit (-1);
+           _exit(1);
            /* NOTREACHED */
 
        default:
@@ -2844,7 +2844,7 @@ openURL (CT ct, char **file)
        execvp(program, args.msgs);
        fprintf(stderr, "Unable to exec ");
        perror(program);
-       _exit(-1);
+       _exit(1);
        /* NOTREACHED */
 
     default:
index 512ea2f..f0b5ef4 100644 (file)
@@ -227,7 +227,7 @@ DisplayMsgHeader (CT ct, char *form, int concatsw)
        execvp (file, vec);
        fprintf (stderr, "unable to exec ");
        perror (mhlproc);
-       _exit (-1);
+       _exit(1);
        /* NOTREACHED */
 
     default:
@@ -483,7 +483,7 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer,
            execvp (file, vec);
            fprintf (stderr, "unable to exec ");
            perror (buffer);
-           _exit (-1);
+           _exit(1);
            /* NOTREACHED */
 
        default: {
index 1a541e2..56ae555 100644 (file)
@@ -1537,7 +1537,7 @@ make_bcc_file (int dashstuff)
                execvp (program, vec);
                fprintf (stderr, "unable to exec ");
                perror (mhlproc);
-               _exit (-1);
+               _exit(1);
 
            default: 
                pidXwait (child_id, mhlproc);
@@ -2012,7 +2012,7 @@ fcc (char *file, char *folder)
            arglist[argp++] = fold;
            arglist[argp] = NULL;
            execvp (program, arglist);
-           _exit (-1);
+           _exit(1);
 
        default: 
            if ((status = pidwait (child_id, OK))) {
index 101aa5a..2c66fa6 100644 (file)
@@ -230,11 +230,11 @@ message_fd (char **vec)
     /* child process */
     rewind (stdin);
     if (dup2 (fd, 1) == NOTOK || dup2 (fd, 2) == NOTOK)
-       _exit (-1);
+       _exit(1);
     closefds (3);
     setpgid(0, getpid());      /* put in own process group */
     if (execvp (vec[0], vec) == NOTOK) {
-        _exit (-1);
+        _exit(1);
     }
 
     return NOTOK;
index afcf2ff..f99b6d0 100644 (file)
@@ -470,7 +470,7 @@ replfilter (FILE *in, FILE *out, char *filter, int fmtproc)
                write(2, "\n", 1) < 0) {
                advise ("stderr", "write");
            }
-           _exit (-1);
+           _exit(1);
 
        default:
            if (pidXwait (pid, mhl))
index 75a25ed..371321c 100644 (file)
@@ -100,7 +100,7 @@ sendsbr (char **vec, int vecp, char *program, char *draft, struct stat *st,
        execvp(buildprogram, buildvec);
        fprintf(stderr, "unable to exec ");
        perror(buildmimeproc);
-       _exit(-1);
+       _exit(1);
        break;
 
     default:
@@ -467,7 +467,7 @@ sendaux (char **vec, int vecp, char *program, char *drft, struct stat *st)
        execvp (program, vec);
        fprintf (stderr, "unable to exec ");
        perror (postproc);
-       _exit (-1);
+       _exit(1);
 
     default:
        /*
@@ -570,7 +570,7 @@ alert (char *file, int out)
            execvp (program, arglist);
            fprintf (stderr, "unable to exec ");
            perror (mailproc);
-           _exit (-1);
+           _exit(1);
 
        default:                /* no waiting... */
            break;
index 6027eab..6866a0b 100644 (file)
@@ -1091,7 +1091,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress)
            setenv("SHELL", pw->pw_shell, 1);
 
            execvp (pgm, vec);
-           _exit (-1);
+           _exit(1);
 
        default: 
            /* parent process */
index c27ee63..98052e3 100644 (file)
@@ -722,7 +722,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp,
            execvp (prog, vec);
            fprintf (stderr, "unable to exec ");
            perror (*ed);
-           _exit (-1);
+           _exit(1);
 
        default:
            if ((status = pidwait (pid, NOTOK))) {
@@ -836,7 +836,7 @@ sendfile (char **arg, char *file, int pushsw)
            execvp (program, vec);
            fprintf (stderr, "unable to exec ");
            perror (sendproc);
-           _exit (-1);
+           _exit(1);
 
        default:
            if (pidwait(child_id, OK) == 0)
@@ -1276,7 +1276,7 @@ whomfile (char **arg, char *file)
            execvp (program, vec);
            fprintf (stderr, "unable to exec ");
            perror (whomproc);
-           _exit (-1);         /* NOTREACHED */
+           _exit(1);           /* NOTREACHED */
 
        default:
            return pidwait(pid, NOTOK) & 0377 ? 1 : 0;
index 00af980..39a6470 100644 (file)
@@ -202,5 +202,5 @@ main (int argc, char **argv)
     execvp (postproc, vec);
     fprintf (stderr, "unable to exec ");
     perror (postproc);
-    _exit (-1);
+    _exit(1);
 }