From 50efcb895e36da97597dbf98fd20cd9a01e76d24 Mon Sep 17 00:00:00 2001
From: vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Date: Fri, 3 Feb 2006 00:16:53 +0000
Subject: gavinl writes in Bug 661: if read() file return less than 1, we
 should close the fd and then goto end.

git-svn-id: svn://busybox.net/trunk/busybox@13800 69ca8d6d-28ef-0310-b511-8ec308f3f277
---
 util-linux/mdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index b8c0090fa..8f2312060 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -42,8 +42,8 @@ static void make_device(char *path)
 	snprintf(temp, PATH_MAX, "%s/dev", path);
 	fd = open(temp, O_RDONLY);
 	len = read(fd, temp, PATH_MAX-1);
-	if (len<1) goto end;
 	close(fd);
+	if (len<1) goto end;
 
 	/* Determine device name, type, major and minor */
 
-- 
cgit v1.2.3-55-g6feb