aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2009-11-19 21:16:45 +0000
committerBen Elliston <bje@gcc.gnu.org>2009-11-20 08:16:45 +1100
commitc22c44bac0669a845a101352fe1fd0613974b18f (patch)
tree5c7685176e01006bf7be17770fdf35adb05d2acc /libiberty
parent872d20942396943c60a6c4047ce19a1fc116c29f (diff)
downloadgcc-c22c44bac0669a845a101352fe1fd0613974b18f.zip
gcc-c22c44bac0669a845a101352fe1fd0613974b18f.tar.gz
gcc-c22c44bac0669a845a101352fe1fd0613974b18f.tar.bz2
pex-unix.c (pex_child_error): Define writeerr macro to avoid unused result warnings from write(3) calls.
* pex-unix.c (pex_child_error): Define writeerr macro to avoid unused result warnings from write(3) calls. Undefine writeerr after all uses. From-SVN: r154344
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/pex-unix.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 05e594e..fbc03fe 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-20 Ben Elliston <bje@au.ibm.com>
+
+ * pex-unix.c (pex_child_error): Define writeerr macro to avoid
+ unused result warnings from write(3) calls. Undefine writeerr
+ after all uses.
+
2009-10-08 Daniel Gutson <dgutson@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
index baf2bb4..3753812 100644
--- a/libiberty/pex-unix.c
+++ b/libiberty/pex-unix.c
@@ -368,7 +368,7 @@ static void
pex_child_error (struct pex_obj *obj, const char *executable,
const char *errmsg, int err)
{
-#define writeerr(s) (void) write (STDERR_FILE_NO, s, strlen (s))
+#define writeerr(s) if (write (STDERR_FILE_NO, s, strlen (s))) {}
writeerr (obj->pname);
writeerr (": error trying to exec '");
writeerr (executable);
@@ -377,6 +377,7 @@ pex_child_error (struct pex_obj *obj, const char *executable,
writeerr (": ");
writeerr (xstrerror (err));
writeerr ("\n");
+#undef writeerr
_exit (-1);
}