提交 a8b0fe3f 编写于 作者: B bernard

[shell] Fix compiling issue when DFS is not enable

上级 d0a78615
...@@ -315,12 +315,15 @@ int msh_exec(char* cmd, rt_size_t length) ...@@ -315,12 +315,15 @@ int msh_exec(char* cmd, rt_size_t length)
return 0; return 0;
} }
#endif #endif
#ifdef DFS_USING_WORKDIR
#if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)
/* change to this directory */
if (chdir(cmd) == 0) if (chdir(cmd) == 0)
{ {
return 0; return 0;
} }
#endif #endif
/* truncate the cmd at the first space. */ /* truncate the cmd at the first space. */
{ {
char *tcmd; char *tcmd;
......
...@@ -249,6 +249,7 @@ int cmd_ifconfig(int argc, char** argv) ...@@ -249,6 +249,7 @@ int cmd_ifconfig(int argc, char** argv)
} }
FINSH_FUNCTION_EXPORT_ALIAS(cmd_ifconfig, __cmd_ifconfig, list the information of network interfaces); FINSH_FUNCTION_EXPORT_ALIAS(cmd_ifconfig, __cmd_ifconfig, list the information of network interfaces);
#ifdef RT_LWIP_TCP
int cmd_netstat(int argc, char** argv) int cmd_netstat(int argc, char** argv)
{ {
extern void list_tcps(void); extern void list_tcps(void);
...@@ -257,7 +258,7 @@ int cmd_netstat(int argc, char** argv) ...@@ -257,7 +258,7 @@ int cmd_netstat(int argc, char** argv)
return 0; return 0;
} }
FINSH_FUNCTION_EXPORT_ALIAS(cmd_netstat, __cmd_netstat, list the information of TCP/IP); FINSH_FUNCTION_EXPORT_ALIAS(cmd_netstat, __cmd_netstat, list the information of TCP/IP);
#endif
#endif /* RT_USING_LWIP */ #endif /* RT_USING_LWIP */
int cmd_ps(int argc, char** argv) int cmd_ps(int argc, char** argv)
......
...@@ -70,10 +70,11 @@ const char* finsh_get_prompt() ...@@ -70,10 +70,11 @@ const char* finsh_get_prompt()
#endif #endif
strcpy(finsh_prompt, _PROMPT); strcpy(finsh_prompt, _PROMPT);
#ifdef DFS_USING_WORKDIR #if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)
/* get current working directory */ /* get current working directory */
getcwd(&finsh_prompt[rt_strlen(finsh_prompt)], RT_CONSOLEBUF_SIZE - rt_strlen(finsh_prompt)); getcwd(&finsh_prompt[rt_strlen(finsh_prompt)], RT_CONSOLEBUF_SIZE - rt_strlen(finsh_prompt));
#endif #endif
strcat(finsh_prompt, ">"); strcat(finsh_prompt, ">");
return finsh_prompt; return finsh_prompt;
...@@ -307,7 +308,7 @@ void finsh_thread_entry(void* parameter) ...@@ -307,7 +308,7 @@ void finsh_thread_entry(void* parameter)
shell->device = rt_console_get_device(); shell->device = rt_console_get_device();
RT_ASSERT(shell->device); RT_ASSERT(shell->device);
rt_device_set_rx_indicate(shell->device, finsh_rx_ind); rt_device_set_rx_indicate(shell->device, finsh_rx_ind);
rt_device_open(shell->device, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX); rt_device_open(shell->device, (RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX));
#else #else
RT_ASSERT(shell->device); RT_ASSERT(shell->device);
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册