Changeset 4979403 in mainline for uspace/app
- Timestamp:
- 2011-09-23T15:39:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 286286c
- Parents:
- 8895d05
- git-author:
- Maurizio Lombardi <m.lombardi85@…> (2011-09-23 15:39:07)
- git-committer:
- Jakub Jermar <jakub@…> (2011-09-23 15:39:07)
- Location:
- uspace/app
- Files:
-
- 2 edited
-
bdsh/cmds/modules/mount/mount.c (modified) (3 diffs)
-
init/init.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mount/mount.c
r8895d05 r4979403 43 43 static struct option const long_options[] = { 44 44 { "help", no_argument, 0, 'h' }, 45 { "instance", required_argument, 0, 'i' }, 45 46 { 0, 0, 0, 0 } 46 47 }; … … 68 69 const char *dev = ""; 69 70 int rc, c, opt_ind; 71 unsigned int instance = 0; 72 bool instance_set = false; 73 char **t_argv; 70 74 71 75 argc = cli_count_args(argv); 72 76 73 77 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 74 c = getopt_long(argc, argv, " h", long_options, &opt_ind);78 c = getopt_long(argc, argv, "i:h", long_options, &opt_ind); 75 79 switch (c) { 76 80 case 'h': 77 81 help_cmd_mount(HELP_LONG); 78 82 return CMD_SUCCESS; 83 case 'i': 84 instance = (unsigned int) strtol(optarg, NULL, 10); 85 instance_set = true; 86 break; 79 87 } 80 88 } 89 90 if (instance_set) { 91 argc -= 2; 92 t_argv = &argv[2]; 93 } else 94 t_argv = &argv[0]; 81 95 82 96 if ((argc < 3) || (argc > 5)) { … … 86 100 } 87 101 if (argc > 3) 88 dev = argv[3];102 dev = t_argv[3]; 89 103 if (argc == 5) 90 mopts = argv[4];104 mopts = t_argv[4]; 91 105 92 rc = mount( argv[1], argv[2], dev, mopts, 0);106 rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance); 93 107 if (rc != EOK) { 94 108 printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n", 95 argv[1], argv[2],argv[3], rc);109 t_argv[1], t_argv[2], t_argv[3], rc); 96 110 return CMD_FAILURE; 97 111 } -
uspace/app/init/init.c
r8895d05 r4979403 121 121 122 122 int rc = mount(fstype, ROOT_MOUNT_POINT, ROOT_DEVICE, opts, 123 IPC_FLAG_BLOCKING );123 IPC_FLAG_BLOCKING, 0); 124 124 return mount_report("Root filesystem", ROOT_MOUNT_POINT, fstype, 125 125 ROOT_DEVICE, rc); … … 138 138 { 139 139 int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "", 140 IPC_FLAG_BLOCKING );140 IPC_FLAG_BLOCKING, 0); 141 141 return mount_report("Location service filesystem", LOCFS_MOUNT_POINT, 142 142 LOCFS_FS_TYPE, NULL, rc); … … 261 261 static bool mount_tmpfs(void) 262 262 { 263 int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0 );263 int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0, 0); 264 264 return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT, 265 265 TMPFS_FS_TYPE, NULL, rc); … … 268 268 static bool mount_data(void) 269 269 { 270 int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0 );270 int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0, 0); 271 271 return mount_report("Data filesystem", DATA_MOUNT_POINT, DATA_FS_TYPE, 272 272 DATA_DEVICE, rc);
Note:
See TracChangeset
for help on using the changeset viewer.
