Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_lookup.c

    r19f857a r1e4cada  
    3838#include "vfs.h"
    3939#include <ipc/ipc.h>
    40 #include <macros.h>
    4140#include <async.h>
    4241#include <errno.h>
    43 #include <str.h>
     42#include <string.h>
    4443#include <stdarg.h>
    4544#include <bool.h>
     
    10099        entry.len = len;
    101100
    102         size_t first;   /* the first free index */
    103         size_t last;    /* the last free index */
     101        off_t first;    /* the first free index */
     102        off_t last;     /* the last free index */
    104103
    105104        if (list_empty(&plb_head)) {
     
    178177        memset(plb, 0, cnt2);
    179178        fibril_mutex_unlock(&plb_mutex);
    180        
    181         if (((int) rc < EOK) || (!result))
    182                 return (int) rc;
    183        
    184         result->triplet.fs_handle = (fs_handle_t) rc;
    185         result->triplet.dev_handle = (dev_handle_t) IPC_GET_ARG1(answer);
    186         result->triplet.index = (fs_index_t) IPC_GET_ARG2(answer);
    187         result->size =
    188             (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(answer), IPC_GET_ARG4(answer));
    189         result->lnkcnt = (unsigned int) IPC_GET_ARG5(answer);
    190        
    191         if (lflag & L_FILE)
    192                 result->type = VFS_NODE_FILE;
    193         else if (lflag & L_DIRECTORY)
    194                 result->type = VFS_NODE_DIRECTORY;
    195         else
    196                 result->type = VFS_NODE_UNKNOWN;
    197        
    198         return EOK;
     179
     180        if ((rc == EOK) && (result)) {
     181                result->triplet.fs_handle = (fs_handle_t) IPC_GET_ARG1(answer);
     182                result->triplet.dev_handle = (dev_handle_t) IPC_GET_ARG2(answer);
     183                result->triplet.index = (fs_index_t) IPC_GET_ARG3(answer);
     184                result->size = (size_t) IPC_GET_ARG4(answer);
     185                result->lnkcnt = (unsigned) IPC_GET_ARG5(answer);
     186                if (lflag & L_FILE)
     187                        result->type = VFS_NODE_FILE;
     188                else if (lflag & L_DIRECTORY)
     189                        result->type = VFS_NODE_DIRECTORY;
     190                else
     191                        result->type = VFS_NODE_UNKNOWN;
     192        }
     193
     194        return rc;
    199195}
    200196
     
    218214       
    219215        if (rc == EOK) {
    220                 result->size =
    221                     MERGE_LOUP32(IPC_GET_ARG1(answer), IPC_GET_ARG2(answer));
    222                 result->lnkcnt = (unsigned int) IPC_GET_ARG3(answer);
    223                 if (IPC_GET_ARG4(answer) & L_FILE)
     216                result->size = (size_t) IPC_GET_ARG1(answer);
     217                result->lnkcnt = (unsigned) IPC_GET_ARG2(answer);
     218                if (IPC_GET_ARG3(answer) & L_FILE)
    224219                        result->type = VFS_NODE_FILE;
    225                 else if (IPC_GET_ARG4(answer) & L_DIRECTORY)
     220                else if (IPC_GET_ARG3(answer) & L_DIRECTORY)
    226221                        result->type = VFS_NODE_DIRECTORY;
    227222                else
Note: See TracChangeset for help on using the changeset viewer.