summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_fscmds.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-04-11 12:13:18 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-04-11 12:13:18 -0600
commit03a22b61713b49d36b355c2f286cdfd58739bec5 (patch)
tree9eb46bda1662f9d6a9f81e4eefdb45c0e369ed52 /apps/nshlib/nsh_fscmds.c
parentb80e8be652dfa52e97daa65aa3e550cf31cb2409 (diff)
downloadpx4-nuttx-03a22b61713b49d36b355c2f286cdfd58739bec5.tar.gz
px4-nuttx-03a22b61713b49d36b355c2f286cdfd58739bec5.tar.bz2
px4-nuttx-03a22b61713b49d36b355c2f286cdfd58739bec5.zip
Allow NSH date command with no RTC. This command is useful without an RTC too. Also, this permits testing on the simulator which never has an RTC
Diffstat (limited to 'apps/nshlib/nsh_fscmds.c')
-rw-r--r--apps/nshlib/nsh_fscmds.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c
index 3900fc64a..06947acc7 100644
--- a/apps/nshlib/nsh_fscmds.c
+++ b/apps/nshlib/nsh_fscmds.c
@@ -240,7 +240,7 @@ static inline int ls_specialdir(const char *dir)
static int ls_handler(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
FAR struct dirent *entryp, FAR void *pvarg)
{
- unsigned int lsflags = (unsigned int)pvarg;
+ unsigned int lsflags = (unsigned int)((uintptr_t)pvarg);
int ret;
/* Check if any options will require that we stat the file */
@@ -995,19 +995,22 @@ int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* file
*/
- ret = ls_handler(vtbl, fullpath, NULL, (void*)lsflags);
+ ret = ls_handler(vtbl, fullpath, NULL, (FAR void *)((uintptr_t)lsflags));
}
else
{
/* List the directory contents */
nsh_output(vtbl, "%s:\n", fullpath);
- ret = foreach_direntry(vtbl, "ls", fullpath, ls_handler, (void*)lsflags);
+
+ ret = foreach_direntry(vtbl, "ls", fullpath, ls_handler,
+ (FAR void*)((uintptr_t)lsflags));
if (ret == OK && (lsflags & LSFLAGS_RECURSIVE) != 0)
{
/* Then recurse to list each directory within the directory */
- ret = foreach_direntry(vtbl, "ls", fullpath, ls_recursive, (void*)lsflags);
+ ret = foreach_direntry(vtbl, "ls", fullpath, ls_recursive,
+ (FAR void *)((uintptr_t)lsflags));
}
}