Fixed build issues

This commit is contained in:
Subhra Sankha Sarkar 2020-10-28 17:00:16 +05:30 committed by Xiang Xiao
parent 23ec80fa30
commit 0d74608b2c

View File

@ -84,6 +84,7 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
fd = open(filepath, O_RDONLY); fd = open(filepath, O_RDONLY);
if (fd < 0) if (fd < 0)
{ {
#if defined(CONFIG_NSH_PROC_MOUNTPOINT)
if (strncmp(filepath, CONFIG_NSH_PROC_MOUNTPOINT, if (strncmp(filepath, CONFIG_NSH_PROC_MOUNTPOINT,
strlen(CONFIG_NSH_PROC_MOUNTPOINT)) == 0) strlen(CONFIG_NSH_PROC_MOUNTPOINT)) == 0)
{ {
@ -92,6 +93,7 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
cmd, filepath, NSH_ERRNO); cmd, filepath, NSH_ERRNO);
} }
else else
#endif
{ {
nsh_error(vtbl, g_fmtcmdfailed, cmd, "open", NSH_ERRNO); nsh_error(vtbl, g_fmtcmdfailed, cmd, "open", NSH_ERRNO);
} }
@ -330,6 +332,7 @@ int nsh_foreach_direntry(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
{ {
/* Failed to open the directory */ /* Failed to open the directory */
#if defined(CONFIG_NSH_PROC_MOUNTPOINT)
if (strncmp(dirpath, CONFIG_NSH_PROC_MOUNTPOINT, if (strncmp(dirpath, CONFIG_NSH_PROC_MOUNTPOINT,
strlen(CONFIG_NSH_PROC_MOUNTPOINT)) == 0) strlen(CONFIG_NSH_PROC_MOUNTPOINT)) == 0)
{ {
@ -338,6 +341,7 @@ int nsh_foreach_direntry(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
cmd, dirpath, NSH_ERRNO); cmd, dirpath, NSH_ERRNO);
} }
else else
#endif
{ {
nsh_error(vtbl, g_fmtnosuch, cmd, "directory", dirpath); nsh_error(vtbl, g_fmtnosuch, cmd, "directory", dirpath);
} }