From bc9985b6194aabd4439933925f50e249610577d0 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 15 Apr 2015 12:33:11 +0800 Subject: [PATCH] Server - Ignore SIGPIPE (just let it return a read error) --- src/server/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/main.c b/src/server/main.c index efa354e..9359c4e 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -136,8 +136,11 @@ int main(int argc, char *argv[]) gsCoke_ModbusAddress = Config_GetValue("coke_modbus_address", 0); giCoke_ModbusPort = Config_GetValue_Int("coke_modbus_port", 0); + // - Cleanly tear down the server on SIGINT/SIGTERM signal(SIGINT, sigint_handler); signal(SIGTERM, sigint_handler); + // - ignore SIGPIPE to prevent a crashing client from bringing the server down too + signal(SIGPIPE, SIG_IGN); openlog("odispense2", 0, LOG_LOCAL4); -- 2.20.1