mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-26 00:41:42 +03:00
Fix SIGPIPE causing unexpected exit of example applications
examples/client.c: examples/coap-rd.c: examples/coap-server.c: examples/etsi_iot_01.c: examples/tiny.c: Make the applications ignore SIGPIPE. examples/coap-rd.c: Support clean exit for SIGTERM / SIGQUIT for valgrind testing.
This commit is contained in:
1 parent
16b77c3e6c
commit
003b64ab3f
5 files changed
+35
-1
No files matched your search
@@ -148,6 +148,9 @@ main(int argc, char **argv) {
|
||||
sa.sa_flags = 0;
|
||||
sigaction (SIGINT, &sa, NULL);
|
||||
sigaction (SIGTERM, &sa, NULL);
|
||||
/* So we do not exit on a SIGPIPE */
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigaction (SIGPIPE, &sa, NULL);
|
||||
|
||||
while ( !quit ) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user