mirror of
https://github.com/sheumann/hush.git
synced 2025-01-13 06:30:09 +00:00
gavinl writes in Bug 661:
if read() file return less than 1, we should close the fd and then goto end.
This commit is contained in:
parent
5509228a7b
commit
53d57dbe6b
@ -42,8 +42,8 @@ static void make_device(char *path)
|
|||||||
snprintf(temp, PATH_MAX, "%s/dev", path);
|
snprintf(temp, PATH_MAX, "%s/dev", path);
|
||||||
fd = open(temp, O_RDONLY);
|
fd = open(temp, O_RDONLY);
|
||||||
len = read(fd, temp, PATH_MAX-1);
|
len = read(fd, temp, PATH_MAX-1);
|
||||||
if (len<1) goto end;
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
if (len<1) goto end;
|
||||||
|
|
||||||
/* Determine device name, type, major and minor */
|
/* Determine device name, type, major and minor */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user