diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index fe18b4812..722976d89 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -84,7 +84,18 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, fd = open(filepath, O_RDONLY); if (fd < 0) { - nsh_error(vtbl, g_fmtcmdfailed, cmd, "open", NSH_ERRNO); + if (strncmp(filepath, CONFIG_NSH_PROC_MOUNTPOINT, + strlen(CONFIG_NSH_PROC_MOUNTPOINT)) == 0) + { + nsh_error(vtbl, + "nsh: %s: Could not open %s (is procfs mounted?): %d\n", + cmd, filepath, NSH_ERRNO); + } + else + { + nsh_error(vtbl, g_fmtcmdfailed, cmd, "open", NSH_ERRNO); + } + return ERROR; } @@ -319,7 +330,18 @@ int nsh_foreach_direntry(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, { /* Failed to open the directory */ - nsh_error(vtbl, g_fmtnosuch, cmd, "directory", dirpath); + if (strncmp(dirpath, CONFIG_NSH_PROC_MOUNTPOINT, + strlen(CONFIG_NSH_PROC_MOUNTPOINT)) == 0) + { + nsh_error(vtbl, + "nsh: %s: Could not open %s (is procfs mounted?): %d\n", + cmd, dirpath, NSH_ERRNO); + } + else + { + nsh_error(vtbl, g_fmtnosuch, cmd, "directory", dirpath); + } + return ERROR; } diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c index b158ed39a..d4633e10c 100644 --- a/nshlib/nsh_netcmds.c +++ b/nshlib/nsh_netcmds.c @@ -391,7 +391,9 @@ static int nsh_foreach_netdev(nsh_netdev_callback_t callback, dir = opendir(CONFIG_NSH_PROC_MOUNTPOINT "/net"); if (dir == NULL) { - nsh_error(vtbl, g_fmtcmdfailed, cmd, "opendir", NSH_ERRNO); + nsh_error(vtbl, + "nsh: %s: Could not open %s/net (is procfs mounted?): %d\n", + cmd, CONFIG_NSH_PROC_MOUNTPOINT, NSH_ERRNO); return ERROR; }