Changeset b82985e in mainline for uspace/app/vol/vol.c
- Timestamp:
- 2018-10-12T13:16:04Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d09eeb2
- Parents:
- 6d00aff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vol/vol.c
r6d00aff rb82985e 47 47 vcmd_eject, 48 48 vcmd_insert, 49 vcmd_insert_by_path, 49 50 vcmd_help, 50 51 vcmd_list, … … 155 156 156 157 rc = vol_part_insert(vol, svc_id); 158 if (rc != EOK) { 159 printf("Error inserting volume.\n"); 160 goto out; 161 } 162 163 rc = EOK; 164 out: 165 vol_destroy(vol); 166 return rc; 167 } 168 169 static errno_t vol_cmd_insert_by_path(const char *volspec) 170 { 171 vol_t *vol = NULL; 172 errno_t rc; 173 174 rc = vol_create(&vol); 175 if (rc != EOK) { 176 printf("Error contacting volume service.\n"); 177 goto out; 178 } 179 180 rc = vol_part_insert_by_path(vol, volspec); 157 181 if (rc != EOK) { 158 182 printf("Error inserting volume.\n"); … … 304 328 printf(" %s eject <mp> Eject volume mounted in a directory\n", NAME); 305 329 printf(" %s insert <svc> Insert volume based on service identifier\n", NAME); 330 printf(" %s insert -p <mp> Insert volume based on filesystem path\n", NAME); 306 331 } 307 332 … … 332 357 volspec = argv[i++]; 333 358 } else if (str_cmp(cmd, "insert") == 0) { 334 vcmd = vcmd_insert; 359 if (str_cmp(argv[i], "-p") == 0) { 360 vcmd = vcmd_insert_by_path; 361 ++i; 362 } else { 363 vcmd = vcmd_insert; 364 } 365 335 366 if (argc <= i) { 336 367 printf("Parameter missing.\n"); … … 356 387 rc = vol_cmd_insert(volspec); 357 388 break; 389 case vcmd_insert_by_path: 390 rc = vol_cmd_insert_by_path(volspec); 391 break; 358 392 case vcmd_help: 359 393 print_syntax();
Note:
See TracChangeset
for help on using the changeset viewer.