From d69bdaea5c3261a286be38e41e975223b11e907b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 14 Jul 2003 19:10:00 +0000 Subject: Check th MDA return status. Fixed a bug the input buffering which when using the '-t' option and piping the input caused the parsed headers to be lost. Undo the inclusion of the debian directory and the source package. Tweak the dpkggen.sh script. --- local.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'local.c') diff --git a/local.c b/local.c index bd5f147..98878fa 100644 --- a/local.c +++ b/local.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "local.h" #include "main.h" @@ -191,7 +192,19 @@ void local_cleanup(void) { if(mda_fp) { - fclose(mda_fp); + int status; + + if((status = pclose(mda_fp))) + { + if(WIFSIGNALED(status)) + fprintf(stderr, "MDA died of signal %d\n", WTERMSIG(status)); + else if(WIFEXITED(status)) + fprintf(stderr, "MDA returned nonzero status %d\n", WEXITSTATUS(status)); + else + fprintf(stderr, "MDA failed\n"); + exit(EX_OSERR); + } + mda_fp = NULL; if(verbose) -- cgit v1.2.3