Handle read errors
This commit is contained in:
parent
d13d6a9ed2
commit
33a155e400
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109915
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user