libc: Exit with -errno if we fail initialization
This commit is contained in:
parent
9ab3ab7c40
commit
cedefaf93d
@ -47,8 +47,8 @@ static void check_for_file(int fd, FILE** target_stream, const char* path, const
|
||||
{
|
||||
if (errno == EBADF) *target_stream = fopen(path, mode);
|
||||
else
|
||||
exit(-127);
|
||||
if (!*target_stream) exit(-127);
|
||||
exit(-errno);
|
||||
if (!*target_stream) exit(-errno);
|
||||
errno = 0;
|
||||
}
|
||||
else { *target_stream = fdopen(fd, mode); }
|
||||
|
Loading…
Reference in New Issue
Block a user