diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-11-10 17:42:41 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-11-10 17:42:41 -0300 |
commit | a39453a02f230683c480d7643b1ecfcd3a5ad7a2 (patch) | |
tree | afda5cebc26f780b77ebe52869f89e321a93267d /dpi | |
parent | 67cab0ec64e4b66793675f8e83c4820c5dbd9be3 (diff) |
Fixed a couple file descriptor leaks in dillo's DPI code
Diffstat (limited to 'dpi')
-rw-r--r-- | dpi/bookmarks.c | 9 |
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); |