Thu Jul 31 14:03:16 2008 UTC ()
In the new nonblocking write code, abort on write errors, especially
on EPIPE. This fixes Gnome session hangs if sounds are switched off.
See Gnome bugzilla #542391 for details. Bump PKGREVISION.


(drochner)
diff -r1.70 -r1.71 pkgsrc/audio/esound/Makefile
diff -r1.25 -r1.26 pkgsrc/audio/esound/distinfo
diff -r0 -r1.5 pkgsrc/audio/esound/patches/patch-ac

cvs diff -r1.70 -r1.71 pkgsrc/audio/esound/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/audio/esound/Attic/Makefile 2008/07/30 10:24:40 1.70
+++ pkgsrc/audio/esound/Attic/Makefile 2008/07/31 14:03:16 1.71
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.70 2008/07/30 10:24:40 drochner Exp $ 1# $NetBSD: Makefile,v 1.71 2008/07/31 14:03:16 drochner Exp $
2 2
3DISTNAME= esound-0.2.39 3DISTNAME= esound-0.2.39
 4PKGREVISION= 1
4CATEGORIES= audio 5CATEGORIES= audio
5MASTER_SITES= ${MASTER_SITE_GNOME:=sources/esound/0.2/} 6MASTER_SITES= ${MASTER_SITE_GNOME:=sources/esound/0.2/}
6EXTRACT_SUFX= .tar.bz2 7EXTRACT_SUFX= .tar.bz2
7 8
8MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://www.tux.org/~ricdude/EsounD.html 10HOMEPAGE= http://www.tux.org/~ricdude/EsounD.html
10COMMENT= The Enlightened sound daemon 11COMMENT= The Enlightened sound daemon
11 12
12PKG_INSTALLATION_TYPES= overwrite pkgviews 13PKG_INSTALLATION_TYPES= overwrite pkgviews
13PKG_DESTDIR_SUPPORT= user-destdir 14PKG_DESTDIR_SUPPORT= user-destdir
14 15
15USE_LIBTOOL= YES 16USE_LIBTOOL= YES
16USE_TOOLS+= pkg-config 17USE_TOOLS+= pkg-config

cvs diff -r1.25 -r1.26 pkgsrc/audio/esound/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/audio/esound/Attic/distinfo 2008/07/29 21:58:13 1.25
+++ pkgsrc/audio/esound/Attic/distinfo 2008/07/31 14:03:16 1.26
@@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
1$NetBSD: distinfo,v 1.25 2008/07/29 21:58:13 wiz Exp $ 1$NetBSD: distinfo,v 1.26 2008/07/31 14:03:16 drochner Exp $
2 2
3SHA1 (esound-0.2.39.tar.bz2) = 71dd61502224309784f1d9c274914731cde7c628 3SHA1 (esound-0.2.39.tar.bz2) = 71dd61502224309784f1d9c274914731cde7c628
4RMD160 (esound-0.2.39.tar.bz2) = 1f719fdefe2bb9bc38d7dbf178d84e45451d8249 4RMD160 (esound-0.2.39.tar.bz2) = 1f719fdefe2bb9bc38d7dbf178d84e45451d8249
5Size (esound-0.2.39.tar.bz2) = 423581 bytes 5Size (esound-0.2.39.tar.bz2) = 423581 bytes
6SHA1 (patch-aa) = d734a1004026287071e571ceb3fd346b809a6a30 6SHA1 (patch-aa) = d734a1004026287071e571ceb3fd346b809a6a30
7SHA1 (patch-ab) = cb6d32ce121e46d53286c1d9bdb9b15c411d0c6c 7SHA1 (patch-ab) = cb6d32ce121e46d53286c1d9bdb9b15c411d0c6c
 8SHA1 (patch-ac) = e36246569d85f0baf957d2faa5f787a214054894

File Added: pkgsrc/audio/esound/patches/Attic/patch-ac
$NetBSD: patch-ac,v 1.5 2008/07/31 14:03:16 drochner Exp $

--- esdlib.c.orig	2008-07-15 17:35:15.000000000 +0200
+++ esdlib.c
@@ -90,7 +90,7 @@ read_timeout (int fd, char *buf, size_t 
 	do {
 		pfd[0].revents = 0;
 		rv = poll (pfd, 1, 100);
-	} while (rv == -1 && errno == EINTR);
+	} while (rv == -1 && (errno == EINTR || errno == EAGAIN));
 	
 	if (rv < 1 || !(pfd[0].revents & POLLIN)) {
 		errno = ETIMEDOUT;
@@ -138,9 +138,9 @@ write_timeout (int fd, const char *buf, 
 		do {
 			pfd[0].revents = 0;
 			rv = poll (pfd, 1, 100);
-		} while (rv == -1 && errno == EINTR);
+		} while (rv == -1 && (errno == EINTR || errno == EAGAIN));
 		
-		if (rv < 1 || !(pfd[0].revents & POLLOUT)) {
+		if (rv < 1 || (pfd[0].revents & (POLLERR | POLLHUP | POLLOUT)) != POLLOUT) {
 			fcntl (fd, F_SETFL, flags);
 			errno = ETIMEDOUT;
 			return -1;
@@ -150,8 +150,14 @@ write_timeout (int fd, const char *buf, 
 			n = write (fd, buf + nwritten, buflen - nwritten);
 		} while (n == -1 && errno == EINTR);
 		
-		if (n > 0)
-			nwritten += n;
+		if (n == -1) {
+			rv = errno;
+			fcntl (fd, F_SETFL, flags);
+			errno = rv;
+			return -1;
+		}
+		
+		nwritten += n;
 	} while (nwritten < buflen);
 	
 	fcntl (fd, F_SETFL, flags);