mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2024-11-03 04:17:18 -05:00
Improve fgets() error handling
This commit is contained in:
parent
f05462c7ea
commit
1fe0ab595c
@ -126,10 +126,12 @@ _playlist_run_program(struct playlist *pl)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
fgets(buf, (int)sizeof(buf), filep);
|
if (NULL == fgets(buf, (int)sizeof(buf), filep)) {
|
||||||
if (ferror(filep)) {
|
if (ferror(filep))
|
||||||
log_error("%s: output read error: %s", pl->filename,
|
log_error("%s: output read error: %s", pl->filename,
|
||||||
strerror(ferror(filep)));
|
strerror(ferror(filep)));
|
||||||
|
else
|
||||||
|
log_error("%s: output read error: EOF", pl->filename);
|
||||||
pclose(filep);
|
pclose(filep);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user