aboutsummaryrefslogtreecommitdiff
path: root/libiberty/pex-unix.c
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2009-11-19 21:17:04 +0000
committerBen Elliston <bje@au.ibm.com>2009-11-19 21:17:04 +0000
commit17f99e29c53d7bee6f4a236edc1f71fe9ed1f029 (patch)
tree9f90fc8fbb410bbfd568836c6e0256336606bb92 /libiberty/pex-unix.c
parentc561c2760cb35c65d64aabe484e1ca960d51b573 (diff)
downloadgdb-17f99e29c53d7bee6f4a236edc1f71fe9ed1f029.zip
gdb-17f99e29c53d7bee6f4a236edc1f71fe9ed1f029.tar.gz
gdb-17f99e29c53d7bee6f4a236edc1f71fe9ed1f029.tar.bz2
* pex-unix.c (pex_child_error): Define writeerr macro to avoid
unused result warnings from write(3) calls. Undefine writeerr after all uses.
Diffstat (limited to 'libiberty/pex-unix.c')
-rw-r--r--libiberty/pex-unix.c3
1 files changed, 2 insertions, 1 deletions
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);
}