[commit: process] master: Fix warning about unused result. (2cdacc6)

Geoffrey Mainland gmainlan at microsoft.com
Mon Jun 3 14:16:59 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/process

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2cdacc6e6e272d050e19b9eccfb0fbaa2b6e6dfd

>---------------------------------------------------------------

commit 2cdacc6e6e272d050e19b9eccfb0fbaa2b6e6dfd
Author: Geoffrey Mainland <mainland at apeiron.net>
Date:   Mon Jun 3 13:15:09 2013 +0100

    Fix warning about unused result.
    
    This error was breaking validate on Linux for me.

>---------------------------------------------------------------

 cbits/runProcess.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cbits/runProcess.c b/cbits/runProcess.c
index 6c4652d..3462cfc 100644
--- a/cbits/runProcess.c
+++ b/cbits/runProcess.c
@@ -45,10 +45,11 @@ extern void unblockUserSignals(void);
 __attribute__((__noreturn__))
 static void childFailed(int pipe, int failCode) {
     int err;
+    ssize_t unused __attribute__((unused));
 
     err = errno;
-    write(pipe, &failCode, sizeof(failCode));
-    write(pipe, &err,      sizeof(err));
+    unused = write(pipe, &failCode, sizeof(failCode));
+    unused = write(pipe, &err,      sizeof(err));
     // As a fallback, exit with the failCode
     _exit(failCode);
 }





More information about the ghc-commits mailing list