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 7232915..38cb741 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 af42bd3..c60d932 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 00fc276..340e995 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);