Ignore:
Timestamp:
2011-11-09T20:27:30Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
747ef72
Parents:
4d562fd
Message:

Print service name instead of ID in list of mounted file systems.

File:
1 edited

Legend:

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

    r4d562fd r2e1b9dc  
    2727 */
    2828
     29#include <loc.h>
    2930#include <stdio.h>
    3031#include <stdlib.h>
     
    6768{
    6869        LIST_INITIALIZE(mtab_list);
     70        mtab_ent_t *old_ent = NULL;
     71        char *svc_name;
     72        int rc;
     73
    6974        get_mtab_list(&mtab_list);
    70 
    71         mtab_ent_t *old_ent = NULL;
    7275
    7376        list_foreach(mtab_list, cur) {
     
    8386                if (mtab_ent->instance)
    8487                        printf("/%d", mtab_ent->instance);
    85                 printf(" on %s ", mtab_ent->mp);
     88
     89                printf(" %s", mtab_ent->mp);
     90
     91                rc = loc_service_get_name(mtab_ent->service_id, &svc_name);
     92                if (rc == EOK) {
     93                        printf(" %s", svc_name);
     94                        free(svc_name);
     95                } else {
     96                        printf(" (%" PRIun ")", mtab_ent->service_id);
     97                }
    8698
    8799                if (str_size(mtab_ent->opts) > 0)
    88                         printf("opts=%s ", mtab_ent->opts);
     100                        printf(" (%s)", mtab_ent->opts);
    89101
    90                 printf("(service=%" PRIun ")\n", mtab_ent->service_id);
     102                putchar('\n');
    91103        }
    92104
Note: See TracChangeset for help on using the changeset viewer.