diff options
author | Micael Karlberg <bmk@erlang.org> | 2022-06-01 20:08:55 +0200 |
---|---|---|
committer | Micael Karlberg <bmk@erlang.org> | 2022-06-01 20:08:55 +0200 |
commit | 87f746b40b11531cf25fbbfb7ac33d6e8e03a279 (patch) | |
tree | 7e5c65da2a58bba8f6905429afd1d82d2aa017bb /erts/emulator/drivers | |
parent | 174d01848e85b5c5235b480be14514559599c525 (diff) | |
download | erlang-87f746b40b11531cf25fbbfb7ac33d6e8e03a279.tar.gz |
[erts|inet-drv] Fixed debug printout
The printout cound not be done in some cases.
There was a driver_exit call in some cases. If that
was the case the debug printout could not be done,
since it used the debug flag (among other things).
OTP-18032
Diffstat (limited to 'erts/emulator/drivers')
-rw-r--r-- | erts/emulator/drivers/common/inet_drv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index 136debcc7a..d708afd0e8 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -10031,9 +10031,12 @@ static ErlDrvSSizeT inet_ctl(inet_descriptor* desc, int cmd, char* buf, sres = inet_set_opts(desc, buf, len); - DDBG(desc, - ("INET-DRV-DBG[%d][%d,%T] inet_ctl(setopts) -> sres: %d\r\n", - __LINE__, desc->s, driver_caller(desc->port), sres) ); + /* We cannot debug-print if sres == 0 since we have then actually * + * completed a driver_exit => we have no longer a descriptor! */ + if (sres != 0) + DDBG(desc, + ("INET-DRV-DBG[%d][%d,%T] inet_ctl(setopts) -> sres: %d\r\n", + __LINE__, desc->s, driver_caller(desc->port), sres) ); switch(sres) { case -1: |