diff options
author | Lukas Larsson <[email protected]> | 2011-12-07 14:47:40 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-12-08 15:13:31 +0100 |
commit | 4181dc36580a0ec7476aeed389948976a89c755d (patch) | |
tree | 5bd97dca565eaf86cbf3b0a2e36e268d4ef3e469 /erts/emulator/drivers/common/efile_drv.c | |
parent | 1137c0a08b25ab5e38286260f0b7c51ba015afbb (diff) | |
download | otp-4181dc36580a0ec7476aeed389948976a89c755d.tar.gz otp-4181dc36580a0ec7476aeed389948976a89c755d.tar.bz2 otp-4181dc36580a0ec7476aeed389948976a89c755d.zip |
Fix cleanup when sendfile process crashes
When sendfile crashes during a send there should be no
error_logger printouts about stolen fds.
Diffstat (limited to 'erts/emulator/drivers/common/efile_drv.c')
-rw-r--r-- | erts/emulator/drivers/common/efile_drv.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index 32914d3b22..5943bca27d 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -734,6 +734,15 @@ file_stop(ErlDrvData e) TRACE_C('p'); +#ifdef HAVE_SENDFILE + if (desc->sendfile_state == sending && !USE_THRDS_FOR_SENDFILE) { + driver_select(desc->port,(ErlDrvEvent)(long)desc->d->c.sendfile.out_fd, + ERL_DRV_WRITE|ERL_DRV_USE,0); + } else if (desc->sendfile_state == sending) { + SET_NONBLOCKING(desc->d->c.sendfile.out_fd); + } +#endif /* HAVE_SENDFILE */ + if (desc->fd != FILE_FD_INVALID) { do_close(desc->flags, desc->fd); desc->fd = FILE_FD_INVALID; |