[erlang-patches] [PATCH 2/2] epmd: fix compiler warnings

Michael Santos <>
Fri Jun 3 16:34:15 CEST 2011


Suppress compiler warnings about ignored return values.
---
 erts/epmd/src/epmd.c     |    6 +++++-
 erts/epmd/src/epmd_cli.c |    5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c
index 08576d9..2267f9b 100644
--- a/erts/epmd/src/epmd.c
+++ b/erts/epmd/src/epmd.c
@@ -324,7 +324,11 @@ static void run_daemon(EpmdVars *g)
       }
 
     /* move cwd to root to make sure we are not on a mounted filesystem  */
-    chdir("/");
+    if (chdir("/") < 0)
+      {
+	dbg_perror(g,"epmd: chdir() failed");
+	epmd_cleanup_exit(g,1);
+      }
     
     umask(0);
 
diff --git a/erts/epmd/src/epmd_cli.c b/erts/epmd/src/epmd_cli.c
index ac55ba6..2377c0d 100644
--- a/erts/epmd/src/epmd_cli.c
+++ b/erts/epmd/src/epmd_cli.c
@@ -104,7 +104,10 @@ void epmd_call(EpmdVars *g,int what)
     fd = conn_to_epmd(g);
     put_int16(1,buf);
     buf[2] = what;
-    write(fd,buf,3);
+    if (write(fd, buf, 3) != 3) {
+	printf("epmd: Can't write to epmd\n");
+	epmd_cleanup_exit(g,1);
+    }
     if (read(fd,(char *)&i,4) != 4) {
 	if (!g->silent)
 	    printf("epmd: no response from local epmd\n");
-- 
1.7.0.4



More information about the erlang-patches mailing list