aboutsummaryrefslogtreecommitdiffstats
path: root/erts/epmd/src/epmd_cli.c
diff options
context:
space:
mode:
authorJohannes Weißl <[email protected]>2013-11-12 16:58:02 +0100
committerHenrik Nord <[email protected]>2014-01-14 11:55:34 +0100
commit3645c345ac88305140b3474fbbbca5c47236933c (patch)
tree3ad8e928c535b388a6d97d95e8faa35894d7e3d6 /erts/epmd/src/epmd_cli.c
parent9128cbdccddc8f76c7dddb6c271b7b4f5c9f5d10 (diff)
downloadotp-3645c345ac88305140b3474fbbbca5c47236933c.tar.gz
otp-3645c345ac88305140b3474fbbbca5c47236933c.tar.bz2
otp-3645c345ac88305140b3474fbbbca5c47236933c.zip
epmd: Fix -names option on Windows
Since 3aa60cc `epmd -names` does not produce any output on Windows anymore. This patch uses fwrite() instead of write() which adds the necessary carriage returns to the output so that it is suitable for the Windows cmd.exe. A test case is added (fails on Windows without the patch).
Diffstat (limited to 'erts/epmd/src/epmd_cli.c')
-rw-r--r--erts/epmd/src/epmd_cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/epmd/src/epmd_cli.c b/erts/epmd/src/epmd_cli.c
index 8817bde8d7..bd30bc35d9 100644
--- a/erts/epmd/src/epmd_cli.c
+++ b/erts/epmd/src/epmd_cli.c
@@ -118,7 +118,7 @@ void epmd_call(EpmdVars *g,int what)
if (!g->silent) {
rval = erts_snprintf(buf, OUTBUF_SIZE,
"epmd: up and running on port %d with data:\n", j);
- write(1, buf, rval);
+ fwrite(buf, 1, rval, stdout);
}
while(1) {
if ((rval = read(fd,buf,OUTBUF_SIZE)) <= 0) {
@@ -126,7 +126,7 @@ void epmd_call(EpmdVars *g,int what)
epmd_cleanup_exit(g,0);
}
if (!g->silent)
- write(1, buf, rval); /* Potentially UTF-8 encoded */
+ fwrite(buf, 1, rval, stdout); /* Potentially UTF-8 encoded */
}
}