chiark / gitweb /
Apply the remains of Ross's patch to build on Ubuntu 8.10.
authorRichard Kettlewell <richard@araminta>
Sat, 31 Jan 2009 14:57:30 +0000 (14:57 +0000)
committerRichard Kettlewell <richard@araminta>
Sat, 31 Jan 2009 14:57:30 +0000 (14:57 +0000)
http://code.google.com/p/disorder/issues/detail?id=24

lib/event.c
server/play.c
server/speaker.c

index 7232915df4426a9f5dfc1135476de8e1b6dab059..38cb741ce406cb7154c17e196885255e25bd6123 100644 (file)
@@ -517,7 +517,9 @@ static void sighandler(int s) {
 
   /* probably the reader has stopped listening for some reason */
   if(write(sigfd[s], &sc, 1) < 0) {
-    write(2, errmsg, sizeof errmsg - 1);
+       /* do the best we can as we're about to abort; shut _up_, gcc */
+       int _ignore = write(2, errmsg, sizeof errmsg - 1);
+       (void)_ignore;
     abort();
   }
 }
index af42bd3ae2a17e819859a22396edbcfba9e58731..c60d9325b9a2ca96de83da01d4c6ea9a7deea09d 100644 (file)
@@ -365,7 +365,8 @@ static int start(ev_source *ev,
             || write(sfd, q->id, l) < 0)
            fatal(errno, "writing to %s", addr.sun_path);
          /* Await the ack */
-         read(sfd, &l, 1);
+         if (read(sfd, &l, 1) < 0) 
+               fatal(errno, "reading ack from %s", addr.sun_path);
          /* Plumbing */
          xdup2(np[0], 0);
          xdup2(sfd, 1);
index 00fc2767b63dcdac0df4ca11fc76def715881e9c..340e995a84c40e35779c934e3ee0b2fe99f6d6c5 100644 (file)
@@ -490,7 +490,8 @@ static void mainloop(void) {
           id[l] = 0;
           D(("id %s fd %d", id, fd));
           t = findtrack(id, 1/*create*/);
-          write(fd, "", 1);             /* write an ack */
+          if (write(fd, "", 1) < 0)             /* write an ack */
+                       error(errno, "writing ack to inbound connection");
           if(t->fd != -1) {
             error(0, "%s: already got a connection", id);
             xclose(fd);