lib/fdtable: Can call zephyr_write() only for CONFIG_NEWLIB_LIBC
If we don't have Newlib, the more or less POSIX library, it's unclear
how to deal with POSIX stdin/stdout/stderr at all.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
diff --git a/lib/fdtable.c b/lib/fdtable.c
index dfaa226..10a97b7 100644
--- a/lib/fdtable.c
+++ b/lib/fdtable.c
@@ -202,10 +202,12 @@
static ssize_t stdinout_write_vmeth(void *obj, const void *buffer, size_t count)
{
-#ifdef CONFIG_BOARD_NATIVE_POSIX
+#if defined(CONFIG_BOARD_NATIVE_POSIX)
return write(1, buffer, count);
-#else
+#elif defined(CONFIG_NEWLIB_LIBC)
return _impl__zephyr_write(buffer, count);
+#else
+ return 0;
#endif
}