aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common/efile_drv.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-08-23 17:19:03 +0200
committerPatrik Nyblom <[email protected]>2013-08-23 17:19:03 +0200
commit076dff38d5aa6fd303b5c2a3aa809115c0545164 (patch)
treec51d17da4e41d64eddb42a4918a3f9d2b5967ded /erts/emulator/drivers/common/efile_drv.c
parentfa5cc308af8c073832cc7b58dd52fa2f523582cc (diff)
parent6d1f1d43aa0a9e0a2cb275ef760339c49518fc69 (diff)
downloadotp-076dff38d5aa6fd303b5c2a3aa809115c0545164.tar.gz
otp-076dff38d5aa6fd303b5c2a3aa809115c0545164.tar.bz2
otp-076dff38d5aa6fd303b5c2a3aa809115c0545164.zip
Merge branch 'pan/bad_async_thread_distribution/OTP-11243' into maint
* pan/bad_async_thread_distribution/OTP-11243: Create better distribution of files over async threads Initialize errno properly in win32 efile_may_openfile Add debug functionality to retrieve async key OTP-11243 OTP-11265
Diffstat (limited to 'erts/emulator/drivers/common/efile_drv.c')
-rw-r--r--erts/emulator/drivers/common/efile_drv.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c
index 9e95325c24..c997fe1bf9 100644
--- a/erts/emulator/drivers/common/efile_drv.c
+++ b/erts/emulator/drivers/common/efile_drv.c
@@ -772,6 +772,7 @@ file_init(void)
return 0;
}
+
/*********************************************************************
* Driver entry point -> start
*/
@@ -788,7 +789,7 @@ file_start(ErlDrvPort port, char* command)
}
desc->fd = FILE_FD_INVALID;
desc->port = port;
- desc->key = (unsigned int) (UWord) port;
+ desc->key = driver_async_port_key(port);
desc->flags = 0;
desc->invoke = NULL;
desc->d = NULL;
@@ -3133,25 +3134,25 @@ file_flush(ErlDrvData e) {
/*********************************************************************
* Driver entry point -> control
+ * Only debug functionality...
*/
static ErlDrvSSizeT
file_control(ErlDrvData e, unsigned int command,
char* buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen) {
- /*
- * warning: variable ‘desc’ set but not used
- * [-Wunused-but-set-variable]
- * ... no kidding ...
- *
- *
file_descriptor *desc = (file_descriptor *)e;
switch (command) {
+ case 'K' :
+ if (rlen < 4) {
+ *rbuf = EF_ALLOC(4);
+ }
+ (*rbuf)[0] = ((desc->key) >> 24) & 0xFF;
+ (*rbuf)[1] = ((desc->key) >> 16) & 0xFF;
+ (*rbuf)[2] = ((desc->key) >> 8) & 0xFF;
+ (*rbuf)[3] = (desc->key) & 0xFF;
+ return 4;
default:
return 0;
- }
- ASSERT(0);
- desc = NULL;
- */
- return 0;
+ }
}
/*********************************************************************