mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2024-11-03 04:17:18 -05:00
Ensure that dup() succeeds (CID 172001)
This commit is contained in:
parent
3a471dc164
commit
89b4260c83
@ -307,6 +307,10 @@ openResource(stream_t stream, const char *fileName, int *popenFlag,
|
||||
int fd;
|
||||
|
||||
stderr_fd = dup(fileno(stderr));
|
||||
if (0 > stderr_fd) {
|
||||
log_alert("dup: %s", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) {
|
||||
log_alert("%s: %s", _PATH_DEVNULL,
|
||||
strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user