diff options
author | Shawn Routhier <sar@isc.org> | 2010-11-18 19:47:36 +0000 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2010-11-18 19:47:36 +0000 |
commit | 3004babab17a9388f603963cdf1d0577536c7c1a (patch) | |
tree | eb26d475a06bf628802edef8308f2ef26d6deaba /omapip/connection.c | |
parent | 3da41c64e14cfbc479977ae95cc429ca06e5eae8 (diff) | |
download | isc-dhcp-3004babab17a9388f603963cdf1d0577536c7c1a.tar.gz |
Ignore sigpipe if possible. 22269
Diffstat (limited to 'omapip/connection.c')
-rw-r--r-- | omapip/connection.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/omapip/connection.c b/omapip/connection.c index ffbb0437..4948070a 100644 --- a/omapip/connection.c +++ b/omapip/connection.c @@ -208,6 +208,19 @@ isc_result_t omapi_connect_list (omapi_object_t *c, return ISC_R_UNEXPECTED; } +#ifdef SO_NOSIGPIPE + /* + * If available stop the OS from killing our + * program on a SIGPIPE failure + */ + flag = 1; + if (setsockopt(obj->socket, SOL_SOCKET, SO_NOSIGPIPE, + (char *)&flag, sizeof(flag)) < 0) { + omapi_connection_dereference (&obj, MDL); + return ISC_R_UNEXPECTED; + } +#endif + status = (omapi_register_io_object ((omapi_object_t *)obj, 0, omapi_connection_writefd, |