From: Ben Elliston Date: Thu, 19 Nov 2009 21:17:04 +0000 (+0000) Subject: * pex-unix.c (pex_child_error): Define writeerr macro to avoid X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17f99e29c53d7bee6f4a236edc1f71fe9ed1f029;p=binutils-gdb.git * pex-unix.c (pex_child_error): Define writeerr macro to avoid unused result warnings from write(3) calls. Undefine writeerr after all uses. --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 05e594e7cf0..fbc03fe83a9 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2009-11-20 Ben Elliston + + * 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 Daniel Jacobowitz Pedro Alves diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c index baf2bb4995b..3753812b314 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); }