chiark / gitweb /
sig.c: Ignore return code from write(2) to pipe.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 May 2010 14:31:30 +0000 (15:31 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 20 Oct 2012 11:40:12 +0000 (12:40 +0100)
We get warnings nowadays about this.  These are annoying.  The only
thing that can go wrong is that the pipe is already full, so the write
will block.  But if that happens, our job is already done: the select(2)
loop will certainly wake up soon because the pipe is full of stuff to be
read.  So ignoring the error here is harmless.

Insert a stupid bodge to shut the compiler up.

sel/sig.c

index 87dbb3334890ef23fe610d97394dfcc7072d04c6..a1dc352c728c56ab21d8369f2efb1f47a420da69 100644 (file)
--- a/sel/sig.c
+++ b/sel/sig.c
@@ -72,11 +72,12 @@ static unsigned nsig;
 
 static void sig_handler(int n)
 {
 
 static void sig_handler(int n)
 {
+  int hunoz;
   int e = errno;
   unsigned char sch = (unsigned char)n;
   sigprocmask(SIG_BLOCK, &ss_all, 0);
   sigaddset(&ss_caught, n);
   int e = errno;
   unsigned char sch = (unsigned char)n;
   sigprocmask(SIG_BLOCK, &ss_all, 0);
   sigaddset(&ss_caught, n);
-  write(sigfd, &sch, 1);
+  hunoz = write(sigfd, &sch, 1);
   /* The system should reset the signal mask here. */
   errno = e;
 }
   /* The system should reset the signal mask here. */
   errno = e;
 }