diff options
author | José Fonseca <jrfonseca@users.sourceforge.net> | 2003-07-14 19:10:00 +0000 |
---|---|---|
committer | José Fonseca <jrfonseca@users.sourceforge.net> | 2003-07-14 19:10:00 +0000 |
commit | d69bdaea5c3261a286be38e41e975223b11e907b (patch) | |
tree | 3751632b9d1d3653cdcff7f1cc560678c2fc8112 /local.c | |
parent | 6537f4cfd63c00812584f1325a19615541f6417a (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.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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) |