From 3645c345ac88305140b3474fbbbca5c47236933c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Wei=C3=9Fl?= Date: Tue, 12 Nov 2013 16:58:02 +0100 Subject: 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). --- erts/epmd/src/epmd_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/epmd/src') 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 */ } } -- cgit v1.2.3