Ignore:
Timestamp:
2011-11-07T23:02:28Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
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.
Message:

Merge from mainline.

File:
1 edited

Legend:

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

    ra0c05e7 r45e7868  
    3030#include <stdlib.h>
    3131#include <vfs/vfs.h>
     32#include <adt/list.h>
    3233#include <errno.h>
    3334#include <getopt.h>
     35#include <inttypes.h>
    3436#include "config.h"
    3537#include "util.h"
     
    6062        }
    6163        return;
     64}
     65
     66static 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);
    6295}
    6396
     
    94127                t_argv = &argv[0];
    95128
    96         if ((argc < 3) || (argc > 5)) {
     129        if ((argc == 2) || (argc > 5)) {
    97130                printf("%s: invalid number of arguments. Try `mount --help'\n",
    98131                    cmdname);
    99132                return CMD_FAILURE;
     133        }
     134        if (argc == 1) {
     135                print_mtab_list();
     136                return CMD_SUCCESS;
    100137        }
    101138        if (argc > 3)
Note: See TracChangeset for help on using the changeset viewer.