diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-11 00:10:42 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-05-11 00:10:42 +0300 |
commit | ffd2cf189d926abe00de0a79f292f1ea69d02aac (patch) | |
tree | ac5047e0bf1a0f2b579bf0d40299d59b2b26cc84 /mtasim | |
parent | 998eaf2cdb444ee77ff67068ce3586de1eea8e4e (diff) | |
download | mailfromd-ffd2cf189d926abe00de0a79f292f1ea69d02aac.tar.gz mailfromd-ffd2cf189d926abe00de0a79f292f1ea69d02aac.tar.bz2 |
Implement some system information functions.
* mfd/bi_gethostname.m4: New file.
* NEWS, doc/mailfromd.texi: Update.
* mfd/Makefile.am (M4_FILES): Add bi_gethostname.m4.
* mfd/bi_system.m4 (uname): New function.
* mfd/prog.c (heap_obstack_cancel, heap_obstack_base): New function.
* mfd/prog.h: Likewise.
* mfd/snarf.m4 (MF_OBSTACK_BASE, MF_OBSTACK_CANCEL): New defuns.
* mtasim/mtasim.c (stop_mailfromd): Reset signal handler before
doing kill, so that waitpid works on hosts with BSD signal semantics.
Diffstat (limited to 'mtasim')
-rw-r--r-- | mtasim/mtasim.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mtasim/mtasim.c b/mtasim/mtasim.c index f9a85f53..ac751d12 100644 --- a/mtasim/mtasim.c +++ b/mtasim/mtasim.c @@ -660,10 +660,14 @@ stop_mailfromd (void) if (child_pid > 0) { int status; + pid_t pid; + signal (SIGCHLD, SIG_DFL); kill (child_pid, SIGTERM); - waitpid (child_pid, &status, 0); - if (WIFEXITED (status)) + pid = waitpid (child_pid, &status, 0); + if (pid == (pid_t) -1) + mu_error ("waitpid: %s", mu_strerror (errno)); + else if (WIFEXITED (status)) { status = WEXITSTATUS (status); if (status != 0) |