[Patch] Esound cleaning its stuff when exiting on error



I've just found a problem is esd when user can't open /dev/dsp (for
example, another user has rw permission on /dev/dsp) => esd doesn't
remove its socket and socket directory.. Therefore, if user with good
permissions on /dev/dsp tries to start esd, it will fail (socket already
exist and is owned by another user..)

Can I commit ?
-- 
Frédéric Crozat
MandrakeSoft
? esound.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/esound/ChangeLog,v
retrieving revision 1.195
diff -u -r1.195 ChangeLog
--- ChangeLog	25 Mar 2002 14:33:56 -0000	1.195
+++ ChangeLog	12 Apr 2002 09:14:15 -0000
@@ -1,3 +1,8 @@
+2002-04-12  Frederic Crozat  <fcrozat mandrakesoft com>
+
+	* esd.c: (main): remove socket/socket directory before exiting
+	when sound device can't be open
+
 2002-03-25  Mark McLoughlin  <mark skynet ie>
 
 	* configure.in: check for gethostbyname2.
Index: esd.c
===================================================================
RCS file: /cvs/gnome/esound/esd.c,v
retrieving revision 1.58
diff -u -r1.58 esd.c
--- esd.c	25 Mar 2002 14:33:56 -0000	1.58
+++ esd.c	12 Apr 2002 09:14:15 -0000
@@ -671,6 +671,10 @@
 	write (esd_spawnfd, &c, 1);
     }
 
+    if (!esd_use_tcpip) {
+	unlink(ESD_UNIX_SOCKET_NAME);
+	rmdir(ESD_UNIX_SOCKET_DIR);
+      }
     exit (2);
   } else if ( itmp < 0 ) {
     fprintf(stderr, "Audio device open for 44.1Khz, stereo, 16bit failed\n"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]