X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/9e4dbc2d5379b96a8d90e28cf8fce803d6cc1ff4..e28d5a554d798965d530d77b8f360e9bb7952e6b:/uip/mhshowsbr.c diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 99bb4067..aee86ecb 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -14,16 +14,16 @@ #include #include #include +#include "h/done.h" #include +#include "mhmisc.h" #include "mhshowsbr.h" -#include "../sbr/m_mktemp.h" +#include "sbr/m_mktemp.h" #ifdef HAVE_ICONV # include #endif /* ! HAVE_ICONV */ extern int debugsw; -extern int npart; -extern int ntype; int nolist = 0; @@ -33,20 +33,13 @@ char *progsw = NULL; int nomore = 0; char *formsw = NULL; -/* for output markerss and headers */ +/* for output markers and headers */ char *folder = NULL; char *markerform; char *headerform; int headersw = -1; -/* mhmisc.c */ -int part_ok (CT); -int part_exact (CT); -int type_ok (CT, int); -void content_error (char *, CT, char *, ...); -void flush_errors (void); - /* * static prototypes */ @@ -201,7 +194,7 @@ static void DisplayMsgHeader (CT ct, char *form, int concatsw) { pid_t child_id; - int i, vecp; + int vecp; char **vec; char *file; @@ -225,9 +218,7 @@ DisplayMsgHeader (CT ct, char *form, int concatsw) fflush (stdout); - for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) - sleep (5); - + child_id = fork(); switch (child_id) { case NOTOK: adios ("fork", "unable to"); @@ -237,7 +228,7 @@ DisplayMsgHeader (CT ct, char *form, int concatsw) execvp (file, vec); fprintf (stderr, "unable to exec "); perror (mhlproc); - _exit (-1); + _exit(1); /* NOTREACHED */ default: @@ -404,7 +395,7 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer, int fd, int xlist, int xstdin, struct format *fmt) { pid_t child_id; - int i, vecp; + int vecp; char **vec, *file; if (debugsw || cracked) { @@ -474,8 +465,7 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer, fflush (stdout); - for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) - sleep (5); + child_id = fork(); switch (child_id) { case NOTOK: advise ("fork", "unable to"); @@ -494,7 +484,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: { @@ -510,7 +500,7 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer, arglist_free(file, vec); if (fd != NOTOK) (*ct->c_ceclosefnx) (ct); - return (alternate ? OK : status); + return alternate ? OK : status; } } }