diff --git a/examples/nsh/nsh.h b/examples/nsh/nsh.h
index 9e072614aa19e2444c609af0329269cbf037cf3d..8bdc0b9dd015a7f3f1fc6d3937e39ca06ba9d69c 100644
--- a/examples/nsh/nsh.h
+++ b/examples/nsh/nsh.h
@@ -296,7 +296,7 @@ extern int nsh_romfsetc(void);
 #ifdef CONFIG_NET
 extern int nsh_netinit(void);
 #else
-#  define nsh_netinit()
+#  define nsh_netinit() (-ENOSYS)
 #endif
 
 #if CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0 && !defined(CONFIG_EXAMPLES_NSH_DISABLESCRIPT)