aboutsummaryrefslogtreecommitdiff
path: root/dpi
diff options
context:
space:
mode:
Diffstat (limited to 'dpi')
-rw-r--r--dpi/bookmarks.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dpi/bookmarks.c b/dpi/bookmarks.c
index 122c8c5e..a4d7c74b 100644
--- a/dpi/bookmarks.c
+++ b/dpi/bookmarks.c
@@ -1704,6 +1704,9 @@ int main(void) {
if (signal (SIGTERM, termination_handler) == SIG_IGN)
signal (SIGTERM, SIG_IGN);
+ /* We may receive SIGPIPE (e.g. socket is closed early by our client) */
+ signal(SIGPIPE, SIG_IGN);
+
/* Initialize local data */
B_bms = dList_new(512);
B_secs = dList_new(32);
@@ -1740,10 +1743,10 @@ int main(void) {
}
dFree(tok);
- if (code == 1)
- exit(1);
- else if (code == 2)
+ if (code != 0) {
+ /* socket is not operative (e.g. closed by client) */
break;
+ }
}
a_Dpip_dsh_close(sh);