example: ignore SIGPIPE
authorFelix Fietkau <nbd@openwrt.org>
Mon, 4 Feb 2013 19:25:22 +0000 (20:25 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 4 Feb 2013 19:25:33 +0000 (20:25 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-example.c

index ab9f6f7537110237ecb4da981ad6cc22c8c1410e..3e10543db12da365319a9d4192be7da3f866afc0 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <signal.h>
 
 #include <libubox/ustream.h>
 #include <libubox/uloop.h>
@@ -199,6 +200,7 @@ int main(int argc, char **argv)
 {
        int ch;
 
+       signal(SIGPIPE, SIG_IGN);
        ctx = ustream_ssl_context_new(true);
        ustream_ssl_context_set_crt_file(ctx, "example.crt");
        ustream_ssl_context_set_key_file(ctx, "example.key");