Ignore:
Timestamp:
2011-09-25T18:46:45Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36cb22f
Parents:
dcc44ca1 (diff), f9d8c3a (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.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    rdcc44ca1 r1db44ea  
    4343static struct option const long_options[] = {
    4444        { "help", no_argument, 0, 'h' },
     45        { "instance", required_argument, 0, 'i' },
    4546        { 0, 0, 0, 0 }
    4647};
     
    6869        const char *dev = "";
    6970        int rc, c, opt_ind;
     71        unsigned int instance = 0;
     72        bool instance_set = false;
     73        char **t_argv;
    7074
    7175        argc = cli_count_args(argv);
    7276
    7377        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);
    7579                switch (c) {
    7680                case 'h':
    7781                        help_cmd_mount(HELP_LONG);
    7882                        return CMD_SUCCESS;
     83                case 'i':
     84                        instance = (unsigned int) strtol(optarg, NULL, 10);
     85                        instance_set = true;
     86                        break;
    7987                }
    8088        }
     89
     90        if (instance_set) {
     91                argc -= 2;
     92                t_argv = &argv[2];
     93        } else
     94                t_argv = &argv[0];
    8195
    8296        if ((argc < 3) || (argc > 5)) {
     
    86100        }
    87101        if (argc > 3)
    88                 dev = argv[3];
     102                dev = t_argv[3];
    89103        if (argc == 5)
    90                 mopts = argv[4];
     104                mopts = t_argv[4];
    91105
    92         rc = mount(argv[1], argv[2], dev, mopts, 0);
     106        rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
    93107        if (rc != EOK) {
    94108                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);
    96110                return CMD_FAILURE;
    97111        }
Note: See TracChangeset for help on using the changeset viewer.