changeset 491:ef654aa76965

Use sigaction() instead of signal()
author mmj
date Tue, 03 May 2005 05:29:55 +1000
parents 6250c7961451
children 9bb06d43c025
files src/mlmmj-send.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mlmmj-send.c	Tue May 03 05:04:20 2005 +1000
+++ b/src/mlmmj-send.c	Tue May 03 05:29:55 2005 +1000
@@ -644,6 +644,7 @@
 	uid_t uid;
 	struct strlist stl;
 	unsigned short smtpport = 25;
+	struct sigaction sigact;
 
 	CHECKFULLPATH(argv[0]);
 	
@@ -654,7 +655,10 @@
 	myfree(bindir);
 	
 	/* install signal handler for SIGTERM */
-	if(signal(SIGTERM, catch_sig_term) == SIG_ERR)
+	sigact.sa_handler = catch_sig_term;
+	sigact.sa_flags = 0;
+	sigemptyset(&sigact.sa_mask);
+	if(sigaction(SIGTERM, &sigact, NULL) < 0)
 		log_error(LOG_ARGS, "Could not install SIGTERM handler!");
 
 	while ((opt = getopt(argc, argv, "aVDhm:l:L:R:F:T:r:s:")) != -1){