tiny patch for linc-cleanup-sockets



Here's a tiny patch for linc: src/cleanup.c.  It keeps
linc-cleanup-sockets from segfaulting in the rare case that the socket
directory doesn't exist.  I've already incorporated this patch in
Debian unstable.  It is, I confess, not a very important patch, but
it's also a tiny patch, and linc-cleanup-sockets *is* in a bin
directory where any random user might run it, so I think it's
justified.

cheers

RCS file: /home/xtifr/cvs/debian/linc/src/cleanup.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- src/cleanup.c	21 May 2002 16:36:40 -0000	1.1.1.1
+++ src/cleanup.c	28 Nov 2002 11:13:36 -0000	1.2
@@ -55,6 +55,8 @@
 	struct dirent *dent;
 
 	dirh = opendir (dir);
+	if (!dirh)
+		return files;	/* assume failure means ENOENT for now */
 
 	while ((dent = readdir (dirh))) {
 		if (strncmp (dent->d_name, "linc-", 5))


-- 
Chris Waters           |  Pneumonoultra-        osis is too long
xtifr@debian.org       |  microscopicsilico-    to fit into a single
or xtifr@speakeasy.net |  volcaniconi-          standalone haiku



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