From 0c6b83703435d837e756d2006c56f643e7e1b7d6 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Fri, 21 Mar 2014 18:53:26 -0400 Subject: [PATCH] Move pidcheck() into mhshowsbr.c (the only consumer of it) and make it static. --- h/mhparse.h | 1 - uip/mhparse.c | 13 ------------- uip/mhshowsbr.c | 18 ++++++++++++++++++ 3 files changed, 18 insertions(+), 14 deletions(-) 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; +} -- 2.56.0