summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard <[email protected]>2017-06-15 14:37:56 +0800
committerbernard <[email protected]>2017-06-15 14:37:56 +0800
commit6515dc238c38ebf8084d0304b97dce2a644f7b1b (patch)
tree2d2667b1a985e04d2828d8e39656777d97a75ea6
parentbc0fbbfe823f771ff3580fb6f861f28573135354 (diff)
[finsh] Add checking the result of chdir.
-rw-r--r--components/finsh/msh_cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c
index 67708d33e6..b5881d897a 100644
--- a/components/finsh/msh_cmd.c
+++ b/components/finsh/msh_cmd.c
@@ -189,7 +189,10 @@ int cmd_cd(int argc, char **argv)
}
else if (argc == 2)
{
- chdir(argv[1]);
+ if (chdir(argv[1]) != 0)
+ {
+ rt_kprintf("No such directory: %s\n", argv[1]);
+ }
}
return 0;