diff options
author | Sverker Eriksson <[email protected]> | 2019-01-31 19:36:01 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2019-01-31 19:36:01 +0100 |
commit | 14fe4c3ccf93c023f851512e573e2bac7d00b232 (patch) | |
tree | 2300a8b2b96e6b6f43d009f72a3e82e818a9eb9d /erts/emulator/drivers/unix | |
parent | 81487129feb5823bf4c3a1721ce655d1e1616781 (diff) | |
parent | 780c5a2c43591fc17925177120b67b99d26e70e7 (diff) | |
download | otp-14fe4c3ccf93c023f851512e573e2bac7d00b232.tar.gz otp-14fe4c3ccf93c023f851512e573e2bac7d00b232.tar.bz2 otp-14fe4c3ccf93c023f851512e573e2bac7d00b232.zip |
Merge branch 'sverker/port-control-badarg/OTP-15555' into maint
* sverker/port-control-badarg/OTP-15555:
erts: Add doc warnings for erlang:port_command|call|control
erts: Add magic port control numbers
Diffstat (limited to 'erts/emulator/drivers/unix')
-rw-r--r-- | erts/emulator/drivers/unix/ttsl_drv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/drivers/unix/ttsl_drv.c b/erts/emulator/drivers/unix/ttsl_drv.c index 28c6cc0f94..d2a524cb6c 100644 --- a/erts/emulator/drivers/unix/ttsl_drv.c +++ b/erts/emulator/drivers/unix/ttsl_drv.c @@ -394,6 +394,8 @@ static ErlDrvSSizeT ttysl_control(ErlDrvData drv_data, { char resbuff[2*sizeof(Uint32)]; ErlDrvSizeT res_size; + + command -= ERTS_TTYSL_DRV_CONTROL_MAGIC_NUMBER; switch (command) { case CTRL_OP_GET_WINSIZE: { @@ -419,7 +421,7 @@ static ErlDrvSSizeT ttysl_control(ErlDrvData drv_data, } break; default: - return 0; + return -1; } if (rlen < res_size) { *rbuf = driver_alloc(res_size); |