aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorHolger Weiß <[email protected]>2010-11-13 23:15:07 +0100
committerHolger Weiß <[email protected]>2010-11-13 23:15:07 +0100
commitb363d7d34a0d5b61131a7edaec2180c6b5103544 (patch)
tree7a032b1b8f9151a263354a1d779d44099b13a31e /erts
parentf26528bbea0a24674e797a58b97117c1f8cf163f (diff)
downloadotp-b363d7d34a0d5b61131a7edaec2180c6b5103544.tar.gz
otp-b363d7d34a0d5b61131a7edaec2180c6b5103544.tar.bz2
otp-b363d7d34a0d5b61131a7edaec2180c6b5103544.zip
Fix epmd's dbg_perror() output
The dbg_perror() function now hands the current errno value over to dbg_gen_printf(). This fixes the problem that errno had been reset to zero by the time it was used (to print the corresponding error message) in the dbg_gen_printf() function.
Diffstat (limited to 'erts')
-rw-r--r--erts/epmd/src/epmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c
index 65ff0cd6b2..47ee4f1150 100644
--- a/erts/epmd/src/epmd.c
+++ b/erts/epmd/src/epmd.c
@@ -487,8 +487,8 @@ static void dbg_gen_printf(int onsyslog,int perr,int from_level,
(int) strlen(timestr)-1, timestr);
len = strlen(buf);
erts_vsnprintf(buf + len, DEBUG_BUFFER_SIZE - len, format, args);
- if (perr == 1)
- perror(buf);
+ if (perr != 0)
+ fprintf(stderr,"%s: %s\r\n",buf,strerror(perr));
else
fprintf(stderr,"%s\r\n",buf);
}
@@ -499,7 +499,7 @@ void dbg_perror(EpmdVars *g,const char *format,...)
{
va_list args;
va_start(args, format);
- dbg_gen_printf(1,1,0,g,format,args);
+ dbg_gen_printf(1,errno,0,g,format,args);
va_end(args);
}