arm start.c: Make runtime function address calculation tolerant for more compilers
[barebox-mini2440.git] / commands / rmdir.c
blob83a0b027de1927032ee99c56bf3d3fb11629fef3
1 #include <common.h>
2 #include <command.h>
3 #include <fs.h>
4 #include <errno.h>
6 static int do_rmdir(struct command *cmdtp, int argc, char *argv[])
8 int i = 1;
10 if (argc < 2)
11 return COMMAND_ERROR_USAGE;
13 while (i < argc) {
14 if (rmdir(argv[i])) {
15 printf("could not remove %s: %s\n", argv[i], errno_str());
16 return 1;
18 i++;
21 return 0;
24 static const __maybe_unused char cmd_rmdir_help[] =
25 "Usage: rmdir [directories]\n"
26 "Remove directories. The directories have to be empty.\n";
28 BAREBOX_CMD_START(rmdir)
29 .cmd = do_rmdir,
30 .usage = "remove directorie(s)",
31 BAREBOX_CMD_HELP(cmd_rmdir_help)
32 BAREBOX_CMD_END