chiark / gitweb /
sel/sig.c: Use `DISCARD' to ignore errors from the signal-pipe `write'.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 5 Jul 2017 20:10:06 +0000 (21:10 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 6 Jul 2017 08:48:25 +0000 (09:48 +0100)
Annoyingly, Clang complains about the empty consequent being on one line
otherwise.  Still, this is what `DISCARD' was made for.

sel/sig.c

index bc55912d75657b913707c08e2ffdf5368ee8cded..0160bf1080bff070367438018596effee31a445b 100644 (file)
--- a/sel/sig.c
+++ b/sel/sig.c
@@ -37,6 +37,7 @@
 
 #include "alloc.h"
 #include "fdflags.h"
+#include "macros.h"
 #include "report.h"
 #include "sel.h"
 #include "sig.h"
@@ -76,7 +77,7 @@ static void sig_handler(int n)
   unsigned char sch = (unsigned char)n;
   sigprocmask(SIG_BLOCK, &ss_all, 0);
   sigaddset(&ss_caught, n);
-  if (write(sigfd, &sch, 1)) /*hunoz*/;
+  DISCARD(write(sigfd, &sch, 1));
   /* The system should reset the signal mask here. */
   errno = e;
 }