libc: make perror output to stderr
This commit is contained in:
parent
b67011c626
commit
88a01fcfc7
@ -15,11 +15,11 @@ extern "C"
|
||||
nwritten += fwrite("\n", 1, 1, stdout);
|
||||
return (int)nwritten;
|
||||
}
|
||||
void perror(const char* s) // FIXME: Print to stderr, whenever we have an stderr.
|
||||
void perror(const char* s)
|
||||
{
|
||||
int savederr =
|
||||
errno; // This was necessary before, but even more now since we clear errno on successful syscalls now.
|
||||
if (s && *s) { printf("%s: ", s); }
|
||||
printf("%s\n", strerror(savederr));
|
||||
if (s && *s) { fprintf(stderr, "%s: ", s); }
|
||||
fprintf(stderr, "%s\n", strerror(savederr));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user