From: Richard Kettlewell Date: Sat, 31 Jan 2009 14:57:30 +0000 (+0000) Subject: Apply the remains of Ross's patch to build on Ubuntu 8.10. X-Git-Tag: 4.3~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/918393ff0ad35af6bb8b8c303f09da13a6c7587e?hp=6f34d1310f0993c32b222dcf8e650da735336537 Apply the remains of Ross's patch to build on Ubuntu 8.10. http://code.google.com/p/disorder/issues/detail?id=24 --- diff --git a/lib/event.c b/lib/event.c index 7232915..38cb741 100644 --- a/lib/event.c +++ b/lib/event.c @@ -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(); } } diff --git a/server/play.c b/server/play.c index af42bd3..c60d932 100644 --- a/server/play.c +++ b/server/play.c @@ -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); diff --git a/server/speaker.c b/server/speaker.c index 00fc276..340e995 100644 --- a/server/speaker.c +++ b/server/speaker.c @@ -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);