summaryrefslogtreecommitdiff
path: root/local.c
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@users.sourceforge.net>2003-07-14 19:10:00 +0000
committerJosé Fonseca <jrfonseca@users.sourceforge.net>2003-07-14 19:10:00 +0000
commitd69bdaea5c3261a286be38e41e975223b11e907b (patch)
tree3751632b9d1d3653cdcff7f1cc560678c2fc8112 /local.c
parent6537f4cfd63c00812584f1325a19615541f6417a (diff)
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.
Diffstat (limited to 'local.c')
-rw-r--r--local.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/local.c b/local.c
index bd5f147..98878fa 100644
--- a/local.c
+++ b/local.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <string.h>
#include <signal.h>
+#include <sys/wait.h>
#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)