summaryrefslogtreecommitdiff
path: root/erts/emulator/drivers
diff options
context:
space:
mode:
authorMicael Karlberg <bmk@erlang.org>2022-06-01 20:08:55 +0200
committerMicael Karlberg <bmk@erlang.org>2022-06-01 20:08:55 +0200
commit87f746b40b11531cf25fbbfb7ac33d6e8e03a279 (patch)
tree7e5c65da2a58bba8f6905429afd1d82d2aa017bb /erts/emulator/drivers
parent174d01848e85b5c5235b480be14514559599c525 (diff)
downloaderlang-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.c9
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: