[shell] Fix compiling issue when DFS is not enable

This commit is contained in:
bernard
2014-09-11 12:47:25 +08:00
parent d0a7861534
commit a8b0fe3f36
3 changed files with 9 additions and 4 deletions

View File

@@ -70,10 +70,11 @@ const char* finsh_get_prompt()
#endif
strcpy(finsh_prompt, _PROMPT);
#ifdef DFS_USING_WORKDIR
#if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)
/* get current working directory */
getcwd(&finsh_prompt[rt_strlen(finsh_prompt)], RT_CONSOLEBUF_SIZE - rt_strlen(finsh_prompt));
#endif
strcat(finsh_prompt, ">");
return finsh_prompt;
@@ -307,7 +308,7 @@ void finsh_thread_entry(void* parameter)
shell->device = rt_console_get_device();
RT_ASSERT(shell->device);
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
RT_ASSERT(shell->device);
#endif