From: Ken Hornstein Date: Fri, 21 Mar 2014 22:53:26 +0000 (-0400) Subject: Move pidcheck() into mhshowsbr.c (the only consumer of it) and make X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/0c6b83703435d837e756d2006c56f643e7e1b7d6?ds=inline Move pidcheck() into mhshowsbr.c (the only consumer of it) and make it static. --- diff --git a/h/mhparse.h b/h/mhparse.h index f58175c0..700c0cc3 100644 --- a/h/mhparse.h +++ b/h/mhparse.h @@ -298,7 +298,6 @@ extern struct str2init str2methods[]; /* * prototypes */ -int pidcheck (int); CT parse_mime (char *); /* diff --git a/uip/mhparse.c b/uip/mhparse.c index 688aba18..444bf7d5 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -181,19 +181,6 @@ struct str2init str2methods[] = { }; -int -pidcheck (int status) -{ - if ((status & 0xff00) == 0xff00 || (status & 0x007f) != SIGQUIT) - return status; - - fflush (stdout); - fflush (stderr); - done (1); - return 1; -} - - /* * Main entry point for parsing a MIME message or file. * It returns the Content structure for the top level diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 207a8e5d..c53f22f3 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -62,6 +62,7 @@ static int show_external (CT, int); static int parse_display_string (CT, char *, int *, int *, char *, char *, size_t, int multipart); static int convert_content_charset (CT, char **); +static int pidcheck(int); /* @@ -1110,3 +1111,20 @@ convert_content_charset (CT ct, char **file) { return OK; } + +/* + * Exit if the display process returned with a nonzero exit code, or terminated + * with a SIGQUIT signal. + */ + +static int +pidcheck (int status) +{ + if ((status & 0xff00) == 0xff00 || (status & 0x007f) != SIGQUIT) + return status; + + fflush (stdout); + fflush (stderr); + done (1); + return 1; +}