diff options
author | Lukas Larsson <[email protected]> | 2019-04-09 14:23:09 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2019-04-09 14:23:09 +0200 |
commit | ab8b9f7aecf4aea31ed2e37677a082fab8bbd1dd (patch) | |
tree | 1ebbbbf0314d0224a3d1609ca0dbee33de971739 /erts/emulator/sys/unix/sys_drivers.c | |
parent | 5dacc0bcaa857f52dd25bb93335f38fd5256e343 (diff) | |
parent | 04c57e50c50d167b65c625d6a9fece8d7b4c7954 (diff) | |
download | otp-ab8b9f7aecf4aea31ed2e37677a082fab8bbd1dd.tar.gz otp-ab8b9f7aecf4aea31ed2e37677a082fab8bbd1dd.tar.bz2 otp-ab8b9f7aecf4aea31ed2e37677a082fab8bbd1dd.zip |
Merge branch 'lukas/erts/fix-fd-driver-select/OTP-15753' into maint
* lukas/erts/fix-fd-driver-select/OTP-15753:
erts: Fix sys_driver to correctly deselect fds
Diffstat (limited to 'erts/emulator/sys/unix/sys_drivers.c')
-rw-r--r-- | erts/emulator/sys/unix/sys_drivers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/sys/unix/sys_drivers.c b/erts/emulator/sys/unix/sys_drivers.c index 042a091db1..664d677ebd 100644 --- a/erts/emulator/sys/unix/sys_drivers.c +++ b/erts/emulator/sys/unix/sys_drivers.c @@ -1006,10 +1006,8 @@ static void clear_fd_data(ErtsSysFdData *fdd) static void nbio_stop_fd(ErlDrvPort prt, ErtsSysFdData *fdd, int use) { - driver_select(prt, abs(fdd->fd), use ? ERL_DRV_USE_NO_CALLBACK : 0|DO_READ|DO_WRITE, 0); clear_fd_data(fdd); SET_BLOCKING(abs(fdd->fd)); - } static void fd_stop(ErlDrvData ev) /* Does not close the fds */ @@ -1026,10 +1024,12 @@ static void fd_stop(ErlDrvData ev) /* Does not close the fds */ if (dd->ifd) { sz += sizeof(ErtsSysFdData); + driver_select(prt, abs(dd->ifd->fd), ERL_DRV_USE_NO_CALLBACK|DO_READ|DO_WRITE, 0); nbio_stop_fd(prt, dd->ifd, 1); } if (dd->ofd && dd->ofd != dd->ifd) { sz += sizeof(ErtsSysFdData); + driver_select(prt, abs(dd->ofd->fd), ERL_DRV_USE_NO_CALLBACK|DO_WRITE, 0); nbio_stop_fd(prt, dd->ofd, 1); } |