diff options
author | Rickard Green <[email protected]> | 2013-02-01 17:07:46 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2013-02-01 17:07:46 +0100 |
commit | 81ec60cb9eae5cebdef2fa4f5a65b7633fd37598 (patch) | |
tree | 75a080d12e5b9d2ba600f4a4b2a63a3788a77732 /erts | |
parent | 9acad61e2bfa3e281e5e17e087811c8b1006165f (diff) | |
download | otp-81ec60cb9eae5cebdef2fa4f5a65b7633fd37598.tar.gz otp-81ec60cb9eae5cebdef2fa4f5a65b7633fd37598.tar.bz2 otp-81ec60cb9eae5cebdef2fa4f5a65b7633fd37598.zip |
Fix unsafe driver_select() from win32 vanilla/spawn drivers
Diffstat (limited to 'erts')
-rwxr-xr-x | erts/emulator/sys/win32/sys.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c index 1cd9072cea..fe66dbd83b 100755 --- a/erts/emulator/sys/win32/sys.c +++ b/erts/emulator/sys/win32/sys.c @@ -749,7 +749,6 @@ static void close_active_handle(ErlDrvPort port_num, HANDLE handle) CloseHandle(thread); } htbc->handles[htbc->cnt++] = handle; - driver_select(port_num, (ErlDrvEvent)handle, ERL_DRV_USE_NO_CALLBACK, 0); SetEvent(htbc->handles[0]); htbc_curr = htbc; LeaveCriticalSection(&htbc_lock); @@ -914,12 +913,8 @@ release_async_io(AsyncIo* aio, ErlDrvPort port_num) CloseHandle(aio->fd); aio->fd = INVALID_HANDLE_VALUE; - if (aio->ov.hEvent != NULL) { - (void) driver_select(port_num, - (ErlDrvEvent)aio->ov.hEvent, - ERL_DRV_USE, 0); - /* was CloseHandle(aio->ov.hEvent); */ - } + if (aio->ov.hEvent != NULL) + CloseHandle(aio->ov.hEvent); aio->ov.hEvent = NULL; @@ -2349,12 +2344,12 @@ stop(ErlDrvData data) if (dp->in.ov.hEvent != NULL) { (void) driver_select(dp->port_num, (ErlDrvEvent)dp->in.ov.hEvent, - ERL_DRV_READ, 0); + ERL_DRV_READ|ERL_DRV_USE_NO_CALLBACK, 0); } if (dp->out.ov.hEvent != NULL) { (void) driver_select(dp->port_num, (ErlDrvEvent)dp->out.ov.hEvent, - ERL_DRV_WRITE, 0); + ERL_DRV_WRITE|ERL_DRV_USE_NO_CALLBACK, 0); } if (dp->out.thread == (HANDLE) -1 && dp->in.thread == (HANDLE) -1) { |