summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-01-21 08:34:02 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-01-21 08:34:02 +0000
commit876a397dbd7f573ca7201c40bc86b19c8c384d86 (patch)
tree19952c4dda2980c5f44884f26ac875d39c671c2a /src
parent08f322dd7d0c82833497e008d11f628cdb805fa7 (diff)
downloadzabbix-876a397dbd7f573ca7201c40bc86b19c8c384d86.tar.gz
zabbix-876a397dbd7f573ca7201c40bc86b19c8c384d86.tar.xz
zabbix-876a397dbd7f573ca7201c40bc86b19c8c384d86.zip
- fixed incorrect handling of timeouts when sendign emails
(Alexei) git-svn-id: svn://svn.zabbix.com/trunk@654 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_sucker/zabbix_sucker.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zabbix_sucker/zabbix_sucker.c b/src/zabbix_sucker/zabbix_sucker.c
index 2295af5d..7986b3ef 100644
--- a/src/zabbix_sucker/zabbix_sucker.c
+++ b/src/zabbix_sucker/zabbix_sucker.c
@@ -994,6 +994,8 @@ int main_alerter_loop()
int i,res;
+ struct sigaction phan;
+
DB_RESULT *result;
DB_ALERT alert;
@@ -1032,6 +1034,12 @@ int main_alerter_loop()
if(strcmp(alert.type,ALERT_TYPE_EMAIL)==0)
{
+
+ phan.sa_handler = &signal_handler;
+ sigemptyset(&phan.sa_mask);
+ phan.sa_flags = 0;
+ sigaction(SIGALRM, &phan, NULL);
+
/* Hardcoded value */
alarm(10);
res = send_email(smtp_server,smtp_helo,smtp_email,alert.sendto,alert.subject,alert.message);
@@ -1285,7 +1293,6 @@ int main(int argc, char **argv)
}
else if(sucker_num == 1)
{
- zabbix_log( LOG_LEVEL_WARNING, "Mailer PID [%d]",getpid());
/* Second instance of zabbix_suckerd sends alerts to users */
main_alerter_loop();
}