summaryrefslogtreecommitdiffstats
path: root/src/zabbix_server/trapper
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-06-02 08:57:29 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-06-02 08:57:29 +0000
commit781c9feb9021f4cbcded4621309583c28315ee2e (patch)
tree60bdf32198a1c212ad3db5f42e58e34b7eb71aa9 /src/zabbix_server/trapper
parent86bd65871b6dc15ce739905a347dadc9b391e223 (diff)
downloadzabbix-781c9feb9021f4cbcded4621309583c28315ee2e.tar.gz
zabbix-781c9feb9021f4cbcded4621309583c28315ee2e.tar.xz
zabbix-781c9feb9021f4cbcded4621309583c28315ee2e.zip
- [ZBX-379] added error checking for accept on server side
git-svn-id: svn://svn.zabbix.com/trunk@5737 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/trapper')
-rw-r--r--src/zabbix_server/trapper/trapper.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/zabbix_server/trapper/trapper.c b/src/zabbix_server/trapper/trapper.c
index ccaa6431..621e9f78 100644
--- a/src/zabbix_server/trapper/trapper.c
+++ b/src/zabbix_server/trapper/trapper.c
@@ -732,12 +732,13 @@ void child_trapper_main(zbx_process_t p, zbx_sock_t *s)
for (;;) {
zbx_setproctitle("trapper [waiting for connection]");
- zbx_tcp_accept(s);
+ if (SUCCEED == zbx_tcp_accept(s)) {
+ zbx_setproctitle("trapper [processing data]");
+ process_trapper_child(s);
- zbx_setproctitle("trapper [processing data]");
- process_trapper_child(s);
-
- zbx_tcp_unaccept(s);
+ zbx_tcp_unaccept(s);
+ } else
+ zabbix_log(LOG_LEVEL_WARNING, "Trapper failed to accept connection");
}
DBclose();
}