dtpic.mui: added MUI4 attributes. (Only attribute
[AROS.git] / arch / all-hosted / bootstrap / log.c
blob8cced78408e6a2eccf0ffdb3fe130bd9cad2210a
1 #include <fcntl.h>
2 #include <stdio.h> /* Needed for STDERR_FILENO on Windows */
3 #ifdef _WIN32
4 #include <io.h>
5 #else
6 #include <unistd.h>
7 #endif
9 #include "log.h"
11 int SetLog(const char *c)
14 * Redirect stderr on filedescriptor level.
15 * Redirecting on streams level does not work with Android's Bionic
17 int fd = open(c, O_WRONLY|O_CREAT|O_APPEND, 0644);
19 if (fd == -1)
20 return -1;
22 if (dup2(fd, STDERR_FILENO) == -1)
24 close(fd);
25 return -1;
28 return 0;