1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Handle read errors

This commit is contained in:
Andrey A. Chernov 2003-01-27 03:14:04 +00:00
parent d13d6a9ed2
commit 33a155e400
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109915

View File

@ -90,11 +90,14 @@ properties_read(int fd)
}
switch(state) {
case FILL:
if ((max = read(fd, buf, sizeof buf)) <= 0) {
if ((max = read(fd, buf, sizeof buf)) < 0) {
properties_free(head);
return (NULL);
}
if (max == 0) {
state = STOP;
break;
}
else {
} else {
state = LOOK;
ch = buf[0];
bp = 1;