Changeset c08fb04 in mainline for uspace/app/bdsh/cmds/modules/mount/mount.c
- Timestamp:
- 2011-11-05T12:37:05Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 72fda53
- Parents:
- 4965357f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mount/mount.c
r4965357f rc08fb04 30 30 #include <stdlib.h> 31 31 #include <vfs/vfs.h> 32 #include <adt/list.h> 32 33 #include <errno.h> 33 34 #include <getopt.h> … … 60 61 } 61 62 return; 63 } 64 65 static void print_mtab_list(void) 66 { 67 LIST_INITIALIZE(mtab_list); 68 get_mtab_list(&mtab_list); 69 70 mtab_list_ent_t *old_ent = NULL; 71 72 list_foreach(mtab_list, cur) { 73 mtab_list_ent_t *ent = list_get_instance(cur, mtab_list_ent_t, 74 link); 75 76 mtab_ent_t *mtab_ent = &ent->mtab_ent; 77 78 if (old_ent) 79 free(old_ent); 80 81 old_ent = ent; 82 83 printf("%s on %s ", mtab_ent->fs_name, mtab_ent->mp); 84 85 if (str_size(mtab_ent->opts) > 0) 86 printf("opts=%s ", mtab_ent->opts); 87 88 printf("(instance=%d, flags=%d, fs_handle=%d)\n", 89 mtab_ent->instance, mtab_ent->flags, mtab_ent->fs_handle); 90 } 91 92 if (old_ent) 93 free(old_ent); 62 94 } 63 95 … … 94 126 t_argv = &argv[0]; 95 127 96 if ((argc < 3) || (argc > 5)) {128 if ((argc == 2) || (argc > 5)) { 97 129 printf("%s: invalid number of arguments. Try `mount --help'\n", 98 130 cmdname); 99 131 return CMD_FAILURE; 132 } 133 if (argc == 1) { 134 print_mtab_list(); 135 return CMD_SUCCESS; 100 136 } 101 137 if (argc > 3)
Note:
See TracChangeset
for help on using the changeset viewer.