Changeset 45e7868 in mainline for uspace/app/bdsh/cmds/modules/mount/mount.c
- Timestamp:
- 2011-11-07T23:02:28Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8c62a71
- Parents:
- a0c05e7 (diff), 7b5f4c9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mount/mount.c
ra0c05e7 r45e7868 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> 35 #include <inttypes.h> 34 36 #include "config.h" 35 37 #include "util.h" … … 60 62 } 61 63 return; 64 } 65 66 static void print_mtab_list(void) 67 { 68 LIST_INITIALIZE(mtab_list); 69 get_mtab_list(&mtab_list); 70 71 mtab_ent_t *old_ent = NULL; 72 73 list_foreach(mtab_list, cur) { 74 mtab_ent_t *mtab_ent = list_get_instance(cur, mtab_ent_t, 75 link); 76 77 if (old_ent) 78 free(old_ent); 79 80 old_ent = mtab_ent; 81 82 printf("%s", mtab_ent->fs_name); 83 if (mtab_ent->instance) 84 printf("/%d", mtab_ent->instance); 85 printf(" on %s ", mtab_ent->mp); 86 87 if (str_size(mtab_ent->opts) > 0) 88 printf("opts=%s ", mtab_ent->opts); 89 90 printf("(service=%" PRIun ")\n", mtab_ent->service_id); 91 } 92 93 if (old_ent) 94 free(old_ent); 62 95 } 63 96 … … 94 127 t_argv = &argv[0]; 95 128 96 if ((argc < 3) || (argc > 5)) {129 if ((argc == 2) || (argc > 5)) { 97 130 printf("%s: invalid number of arguments. Try `mount --help'\n", 98 131 cmdname); 99 132 return CMD_FAILURE; 133 } 134 if (argc == 1) { 135 print_mtab_list(); 136 return CMD_SUCCESS; 100 137 } 101 138 if (argc > 3)
Note:
See TracChangeset
for help on using the changeset viewer.