diff --git a/sys/posix/fd.c b/sys/posix/fd.c index fb13402a45..fd557357d1 100644 --- a/sys/posix/fd.c +++ b/sys/posix/fd.c @@ -21,7 +21,9 @@ #include #include "posix_io.h" +#ifdef MODULE_UART0 #include "board_uart0.h" +#endif #include "unistd.h" #include "fd.h" @@ -38,6 +40,7 @@ int fd_init(void) { memset(fd_table, 0, sizeof(fd_t) * FD_MAX); +#ifdef MODULE_UART0 posix_open(uart0_handler_pid, 0); fd_t fd = { .__active = 1, @@ -49,6 +52,7 @@ int fd_init(void) memcpy(&fd_table[STDIN_FILENO], &fd, sizeof(fd_t)); memcpy(&fd_table[STDOUT_FILENO], &fd, sizeof(fd_t)); memcpy(&fd_table[STDERR_FILENO], &fd, sizeof(fd_t)); +#endif return FD_MAX; }