diff options
author | todd stecher <todd.stecher@gmail.com> | 2009-02-12 00:11:38 -0800 |
---|---|---|
committer | Steven Danneman <steven.danneman@isilon.com> | 2009-02-18 18:08:33 -0800 |
commit | 03421944b2bd82caf13946b745e4d634f0559f82 (patch) | |
tree | e9a6bc17f5703b2d5d1532e3f5dfd9662a729e4a /source3/printing | |
parent | c441f58dedc465f59060296815a0bc7f9aeb743f (diff) | |
download | samba-03421944b2bd82caf13946b745e4d634f0559f82.tar.gz samba-03421944b2bd82caf13946b745e4d634f0559f82.tar.bz2 samba-03421944b2bd82caf13946b745e4d634f0559f82.zip |
S3: Stop creating SMBD cores when failing to create a pipe.
This was uncovered when the MAX FD limit was hit, causing an instant core
and invoking error reporting. This fix causes SMBD to exit, but without
building a core.
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/printing.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 17ddc55efa..7179184b73 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1478,9 +1478,13 @@ void start_background_queue(void) ret = sys_select(maxfd, &r_fds, &w_fds, NULL, &to); - /* If pause_pipe[1] is closed it means the parent smbd - * and children exited or aborted. */ - if (ret == 1 && FD_ISSET(pause_pipe[1], &r_fds)) { + /* + * If pause_pipe[1] is closed it means the parent smbd + * and children exited or aborted. If sys_select() + * failed, then something more sinister is wrong + */ + if ((ret < 0) || + (ret == 1 && FD_ISSET(pause_pipe[1], &r_fds))) { exit_server_cleanly(NULL); } |