Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sysinst/futil.c

    r39330200 r8e3498b  
    5454 * @return EOK on success, EIO on I/O error
    5555 */
    56 errno_t futil_copy_file(const char *srcp, const char *destp)
     56int futil_copy_file(const char *srcp, const char *destp)
    5757{
    5858        int sf, df;
    5959        size_t nr, nw;
    60         errno_t rc;
     60        int rc;
    6161        aoff64_t posr = 0, posw = 0;
    6262
    6363        printf("Copy '%s' to '%s'.\n", srcp, destp);
    6464
    65         rc = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ, &sf);
    66         if (rc != EOK)
    67                 return EIO;
    68 
    69         rc = vfs_lookup_open(destp, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE, &df);
    70         if (rc != EOK)
     65        sf = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ);
     66        if (sf < 0)
     67                return EIO;
     68
     69        df = vfs_lookup_open(destp, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE);
     70        if (df < 0)
    7171                return EIO;
    7272
     
    8787
    8888        rc = vfs_put(df);
    89         if (rc != EOK)
     89        if (rc < 0)
    9090                return EIO;
    9191
     
    104104 * @return EOK on success, ENOMEM if out of memory, EIO on I/O error
    105105 */
    106 errno_t futil_rcopy_contents(const char *srcdir, const char *destdir)
     106int futil_rcopy_contents(const char *srcdir, const char *destdir)
    107107{
    108108        DIR *dir;
    109109        struct dirent *de;
    110         vfs_stat_t s;
     110        struct stat s;
    111111        char *srcp, *destp;
    112         errno_t rc;
     112        int rc;
    113113
    114114        dir = opendir(srcdir);
     
    158158 *         I/O error, ENOMEM if out of memory
    159159 */
    160 errno_t futil_get_file(const char *srcp, void **rdata, size_t *rsize)
     160int futil_get_file(const char *srcp, void **rdata, size_t *rsize)
    161161{
    162162        int sf;
    163163        size_t nr;
    164         errno_t rc;
     164        int rc;
    165165        size_t fsize;
    166166        char *data;
    167         vfs_stat_t st;
    168 
    169         rc = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ, &sf);
    170         if (rc != EOK)
     167        struct stat st;
     168
     169        sf = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ);
     170        if (sf < 0)
    171171                return ENOENT;
    172172
Note: See TracChangeset for help on using the changeset viewer.