Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat.c

    r9934f7d rffa2c8ef  
    3939#include "fat.h"
    4040#include <ipc/services.h>
    41 #include <ns.h>
     41#include <ipc/ns.h>
    4242#include <async.h>
    4343#include <errno.h>
     
    7676 * request has been completed.
    7777 */
    78 static void fat_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     78static void fat_connection(ipc_callid_t iid, ipc_call_t *icall)
    7979{
    8080        if (iid) {
     
    8888       
    8989        dprintf(NAME ": connection opened\n");
     90        while (1) {
     91                ipc_callid_t callid;
     92                ipc_call_t call;
    9093       
    91         while (true) {
    92                 ipc_call_t call;
    93                 ipc_callid_t callid = async_get_call(&call);
    94                
    95                 if (!IPC_GET_IMETHOD(call))
     94                callid = async_get_call(&call);
     95                switch  (IPC_GET_IMETHOD(call)) {
     96                case IPC_M_PHONE_HUNGUP:
    9697                        return;
    97                
    98                 switch (IPC_GET_IMETHOD(call)) {
    9998                case VFS_OUT_MOUNTED:
    10099                        fat_mounted(callid, &call);
     
    145144int main(int argc, char **argv)
    146145{
     146        int vfs_phone;
     147        int rc;
     148
    147149        printf(NAME ": HelenOS FAT file system server\n");
    148        
    149         int rc = fat_idx_init();
     150
     151        rc = fat_idx_init();
    150152        if (rc != EOK)
    151153                goto err;
    152        
    153         async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    154             SERVICE_VFS, 0, 0);
    155         if (!vfs_sess) {
     154
     155        vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
     156        if (vfs_phone < EOK) {
    156157                printf(NAME ": failed to connect to VFS\n");
    157158                return -1;
    158159        }
    159160       
    160         rc = fs_register(vfs_sess, &fat_reg, &fat_vfs_info, fat_connection);
     161        rc = fs_register(vfs_phone, &fat_reg, &fat_vfs_info, fat_connection);
    161162        if (rc != EOK) {
    162163                fat_idx_fini();
     
    167168        task_retval(0);
    168169        async_manager();
    169        
    170         /* Not reached */
     170        /* not reached */
    171171        return 0;
    172        
     172
    173173err:
    174174        printf(NAME ": Failed to register file system (%d)\n", rc);
     
    178178/**
    179179 * @}
    180  */
     180 */ 
Note: See TracChangeset for help on using the changeset viewer.