Changeset 1356a04c in mainline


Ignore:
Timestamp:
2007-12-23T22:38:47Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ee1b8ca
Parents:
7dab6b8
Message:

The vfs1 test now reads a file on a TMPFS file system.

File:
1 edited

Legend:

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

    r7dab6b8 r1356a04c  
    4646        int vfs_phone;
    4747        vfs_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VFS, 0, 0);
    48         if (vfs_phone < EOK) {
     48        if (vfs_phone < EOK)
    4949                return "Could not connect to VFS.\n";
    50         }
    5150       
    5251        /* 2. mount TMPFS as / */
     
    6362        }
    6463        async_wait_for(req, &rc);
    65         if (rc != EOK) {
     64        if (rc != EOK)
    6665                return "Mount failed.\n";
    67         }
    6866       
    6967        /* 3. open some files */
     
    7674        }
    7775        async_wait_for(req, &rc);
    78         if (rc != EOK) {
     76        if (rc != EOK)
    7977                return "Open failed.\n";
     78        if (!quiet)
     79                printf("Opened %s handle=%d\n", path, IPC_GET_ARG1(answer));
     80
     81        /* 4. read data */
     82        char buf[10];
     83        req = async_send_1(vfs_phone, VFS_READ, 0, &answer);
     84        if (ipc_data_read_send(vfs_phone, buf, sizeof(buf)) != EOK) {
     85                async_wait_for(req, &rc);
     86                return "Could not read data from open file.\n";
    8087        }
    81 
    82         if (!quiet) {
    83                 printf("Opened %s handle=%d\n", path, IPC_GET_ARG1(answer));
    84         }
     88        async_wait_for(req, &rc);
     89        if (rc != EOK)
     90                return "Read failed.\n";
     91        printf("Read %d bytes: %s\n", IPC_GET_ARG1(answer), buf);
    8592
    8693        return NULL;
Note: See TracChangeset for help on using the changeset viewer.