Changeset 2f60a529 in mainline for uspace/app/tester/vfs/vfs1.c


Ignore:
Timestamp:
2008-03-28T07:54:14Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e790e6
Parents:
e190a89b
Message:

Return EBUSY if trying to mount something over an already mounted root FS.
(Contributed by Tim Post)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/vfs/vfs1.c

    re190a89b r2f60a529  
    4444char *test_vfs1(bool quiet)
    4545{
    46         if (mount("tmpfs", "/", "nulldev0") != EOK)
    47                 return "mount() failed.\n";
    48         if (!quiet)
    49                 printf("mounted tmpfs on /.\n");
     46        int rc;
     47
     48        rc = mount("tmpfs", "/", "nulldev0");
     49        switch (rc) {
     50        case EOK:
     51                if (!quiet)
     52                        printf("mounted tmpfs on /\n");
     53                break;
     54        case EBUSY:
     55                if (!quiet)
     56                        printf("(INFO) something is already mounted on /\n");
     57                break;
     58        default:
     59                if (!quiet)
     60                        printf("(INFO) IPC returned errno %d\n", rc);
     61                return "mount() failed.";
     62        }
    5063
    5164        if (mkdir("/mydir", 0) != 0)
Note: See TracChangeset for help on using the changeset viewer.