aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-07-23 03:40:34 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-07-23 03:40:34 +0000
commit06470851ed8433e49fcb9de36f0010d2c2d6b7cc (patch)
tree9d26019b93cee176075bbb47e993d6e2ca3df998 /sink.c
parentb481a92175821bd7e2d014282cbf01c457b52d3a (diff)
downloadfetchmail-06470851ed8433e49fcb9de36f0010d2c2d6b7cc.tar.gz
fetchmail-06470851ed8433e49fcb9de36f0010d2c2d6b7cc.tar.bz2
fetchmail-06470851ed8433e49fcb9de36f0010d2c2d6b7cc.zip
Minor update.
svn path=/trunk/; revision=2927
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sink.c b/sink.c
index 8c3d5f54..519fc2bd 100644
--- a/sink.c
+++ b/sink.c
@@ -169,7 +169,11 @@ static int smtp_open(struct query *ctl)
/* these are shared by open_sink and stuffline */
static FILE *sinkfp;
+#ifndef HAVE_SIGACTION
static RETSIGTYPE (*sigchld)(int);
+#else
+static struct sigaction sa_old;
+#endif /* HAVE_SIGACTION */
int stuffline(struct query *ctl, char *buf)
/* ship a line to the given control block's output sink (SMTP server or MDA) */
@@ -488,6 +492,9 @@ int open_sink(struct query *ctl, struct msgblk *msg,
/* set up sinkfp to be an input sink we can ship a message to */
{
struct idlist *idp;
+#ifdef HAVE_SIGACTION
+ struct sigaction sa_new;
+#endif /* HAVE_SIGACTION */
*bad_addresses = *good_addresses = 0;
@@ -688,7 +695,14 @@ int open_sink(struct query *ctl, struct msgblk *msg,
return(PS_IOERR);
}
+#ifndef HAVE_SIGACTION
sigchld = signal(SIGCHLD, SIG_DFL);
+#else
+ memset (&sa_new, 0, sizeof sa_new);
+ sigemptyset (&sa_new.sa_mask);
+ sa_new.sa_handler = SIG_DFL;
+ sigaction (SIGCHLD, &sa_new, &sa_old);
+#endif /* HAVE_SIGACTION */
}
else /* forward to an SMTP or LMTP listener */
{
@@ -873,7 +887,11 @@ void release_sink(struct query *ctl)
pclose(sinkfp);
sinkfp = (FILE *)NULL;
}
+#ifndef HAVE_SIGACTION
signal(SIGCHLD, sigchld);
+#else
+ sigaction (SIGCHLD, &sa_old, NULL);
+#endif /* HAVE_SIGACTION */
}
}
@@ -892,7 +910,11 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward)
}
else
rc = 0;
+#ifndef HAVE_SIGACTION
signal(SIGCHLD, sigchld);
+#else
+ sigaction (SIGCHLD, &sa_old, NULL);
+#endif /* HAVE_SIGACTION */
if (rc)
{
report(stderr,