svn commit: trunk/busybox/util-linux

vapier at busybox.net vapier at busybox.net
Fri Feb 3 00:16:56 UTC 2006


Author: vapier
Date: 2006-02-02 16:16:53 -0800 (Thu, 02 Feb 2006)
New Revision: 13800

Log:
gavinl writes in Bug 661:
if read() file return less than 1, we should close the fd and then goto end.


Modified:
   trunk/busybox/util-linux/mdev.c


Changeset:
Modified: trunk/busybox/util-linux/mdev.c
===================================================================
--- trunk/busybox/util-linux/mdev.c	2006-02-02 23:14:57 UTC (rev 13799)
+++ trunk/busybox/util-linux/mdev.c	2006-02-03 00:16:53 UTC (rev 13800)
@@ -42,8 +42,8 @@
 	snprintf(temp, PATH_MAX, "%s/dev", path);
 	fd = open(temp, O_RDONLY);
 	len = read(fd, temp, PATH_MAX-1);
+	close(fd);
 	if (len<1) goto end;
-	close(fd);
 
 	/* Determine device name, type, major and minor */
 




More information about the busybox-cvs mailing list