diff options
author | se <se@FreeBSD.org> | 2004-12-31 05:51:22 +0800 |
---|---|---|
committer | se <se@FreeBSD.org> | 2004-12-31 05:51:22 +0800 |
commit | 3cbdd9f0e024eeb6c2f419f029e4aad940f04ef8 (patch) | |
tree | c9bf143c16b7739f00284d96e0ca49ed519bd72c /games | |
parent | 69cec7e9e1718923ea464426551d4758c59a1707 (diff) | |
download | freebsd-ports-gnome-3cbdd9f0e024eeb6c2f419f029e4aad940f04ef8.tar.gz freebsd-ports-gnome-3cbdd9f0e024eeb6c2f419f029e4aad940f04ef8.tar.zst freebsd-ports-gnome-3cbdd9f0e024eeb6c2f419f029e4aad940f04ef8.zip |
Make xbsndsrv exit on pipe read errors.
Diffstat (limited to 'games')
-rw-r--r-- | games/xblast/files/patch-ab | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/games/xblast/files/patch-ab b/games/xblast/files/patch-ab index f9c8bbad48a6..936b9edee17c 100644 --- a/games/xblast/files/patch-ab +++ b/games/xblast/files/patch-ab @@ -1,6 +1,6 @@ ---- xbsndsrv.c.orig Sat Sep 7 17:50:18 2002 -+++ xbsndsrv.c Sat Sep 7 17:50:25 2002 -@@ -110,7 +110,7 @@ +--- xbsndsrv.c.orig Wed Jul 7 12:53:13 2004 ++++ xbsndsrv.c Thu Dec 30 21:45:25 2004 +@@ -43,7 +43,7 @@ #include <sys/ioctl.h> #include <sys/time.h> #ifdef __FreeBSD__ @@ -9,3 +9,28 @@ #else #include <linux/soundcard.h> #endif +@@ -723,16 +723,23 @@ + int n; + struct timeval tv; + fd_set rs; ++ fd_set es; + + while(1) + { + tv.tv_sec = tv.tv_usec = 0; + FD_ZERO(&rs); + FD_SET(0, &rs); ++ FD_ZERO(&es); ++ FD_SET(0, &es); + +- if (select(1, &rs, NULL, NULL, &tv) > 0 && FD_ISSET(0, &rs)) ++ if (select(1, &rs, NULL, &es, &tv) > 0 && FD_ISSET(0, &rs)) + { + n = read(0, command_buff, 8); ++ if ((n == 0) && FD_ISSET(0, &es)) { ++ fprintf(stderr, "Parent was killed, bailing out ...\n"); ++ exit(0); ++ } + cmd = command_buff; + /* there are commands in the pipe */ + while (n > 0) |