diff options
author | Rickard Green <[email protected]> | 2013-01-22 18:35:35 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2013-01-22 18:35:35 +0100 |
commit | 3aa60cc472bc330dbe9360eb27a1f340b7e23dc6 (patch) | |
tree | 5ca569797dfe588914c83abc599e03d120cce9cc /erts/epmd/src/epmd_cli.c | |
parent | 5ee4c7136ce8f311e3d3384ae0feb29bcbff6e85 (diff) | |
download | otp-3aa60cc472bc330dbe9360eb27a1f340b7e23dc6.tar.gz otp-3aa60cc472bc330dbe9360eb27a1f340b7e23dc6.tar.bz2 otp-3aa60cc472bc330dbe9360eb27a1f340b7e23dc6.zip |
Add UTF-8 node name support for epmd
Diffstat (limited to 'erts/epmd/src/epmd_cli.c')
-rw-r--r-- | erts/epmd/src/epmd_cli.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/erts/epmd/src/epmd_cli.c b/erts/epmd/src/epmd_cli.c index 74408e3ebe..1d4de64b63 100644 --- a/erts/epmd/src/epmd_cli.c +++ b/erts/epmd/src/epmd_cli.c @@ -22,6 +22,7 @@ #endif #include "epmd.h" /* Renamed from 'epmd_r4.h' */ #include "epmd_int.h" +#include "erl_printf.h" /* erts_snprintf */ /* forward declarations */ @@ -114,16 +115,18 @@ void epmd_call(EpmdVars *g,int what) epmd_cleanup_exit(g,1); } j = ntohl(i); - if (!g->silent) - printf("epmd: up and running on port %d with data:\n", j); + if (!g->silent) { + rval = erts_snprintf(buf, OUTBUF_SIZE, + "epmd: up and running on port %d with data:\n", j); + write(1, buf, rval); + } while(1) { - if ((rval = read(fd,buf,1)) <= 0) { + if ((rval = read(fd,buf,OUTBUF_SIZE)) <= 0) { close(fd); epmd_cleanup_exit(g,0); } - buf[rval] = '\0'; if (!g->silent) - printf("%s",buf); + write(1, buf, rval); /* Potentially UTF-8 encoded */ } } |