aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2009-11-27 21:18:17 +0000
committerBjörn Gustavsson <[email protected]>2009-11-28 23:53:44 +0100
commitace6e42166f0817dce07c85f511eff543bd13ddf (patch)
treee64609d766a6b76c6f424c60ad07c15b6af91b73
parent84adefa331c4159d432d22840663c38f155cd4c1 (diff)
downloadotp-ace6e42166f0817dce07c85f511eff543bd13ddf.tar.gz
otp-ace6e42166f0817dce07c85f511eff543bd13ddf.tar.bz2
otp-ace6e42166f0817dce07c85f511eff543bd13ddf.zip
to_erl: Include strerror(errno) in error messages
to_erl likes to print the message "No running Erlang on pipe ...", no matter what the problem actually was. The wording might make you forget that you just need to run to_erl as another user, for example. With this change, to_erl will print the system error message in addition to its own. Example output: No running Erlang on pipe pipes/erlang.pipe.5: Permission denied (wrong user, wrong permissions, etc) No running Erlang on pipe pipes/erlang.pipe.5: No such device or address (this actually means "no running Erlang") No running Erlang on pipe pipes/erlang.pipe: No such file or directory (not only is there no running Erlang, there are also no pipes at all)
-rw-r--r--erts/etc/unix/to_erl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/etc/unix/to_erl.c b/erts/etc/unix/to_erl.c
index 588d127445..886b301997 100644
--- a/erts/etc/unix/to_erl.c
+++ b/erts/etc/unix/to_erl.c
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
dirp = opendir(pipename);
if(!dirp) {
- fprintf(stderr, "Can't access pipe directory %s.\n", pipename);
+ fprintf(stderr, "Can't access pipe directory %s: %s\n", pipename, strerror(errno));
exit(1);
}
@@ -205,7 +205,7 @@ int main(int argc, char **argv)
#ifdef DEBUG
fprintf(stderr, "Could not open FIFO %s for reading.\n", FIFO1);
#endif
- fprintf(stderr, "No running Erlang on pipe %s.\n", pipename);
+ fprintf(stderr, "No running Erlang on pipe %s: %s\n", pipename, strerror(errno));
exit(1);
}
#ifdef DEBUG
@@ -216,7 +216,7 @@ int main(int argc, char **argv)
#ifdef DEBUG
fprintf(stderr, "Could not open FIFO %s for writing.\n", FIFO2);
#endif
- fprintf(stderr, "No running Erlang on pipe %s.\n", pipename);
+ fprintf(stderr, "No running Erlang on pipe %s: %s\n", pipename, strerror(errno));
close(rfd);
exit(1);
}