aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-03 00:16:53 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-03 00:16:53 +0000
commit53d57dbe6bf54f4a44989e02afc9176d3ce5365f (patch)
tree70286507609f19815a3ed038f208b4af21ddfd57
parent5509228a7b40018ae3e0439a0871f09b44a6e1c7 (diff)
downloadbusybox-53d57dbe6bf54f4a44989e02afc9176d3ce5365f.tar.gz
gavinl writes in Bug 661:
if read() file return less than 1, we should close the fd and then goto end.
-rw-r--r--util-linux/mdev.c2
1 files changed, 1 insertions, 1 deletions
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 */