Changeset f77c1c9 in mainline for uspace/app/sysinst/futil.c


Ignore:
Timestamp:
2017-12-08T21:03:35Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c19a5a59
Parents:
c1694b6b
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 19:44:55)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:03:35)
Message:

Return VFS handles separately from error codes.

File:
1 edited

Legend:

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

    rc1694b6b rf77c1c9  
    6363        printf("Copy '%s' to '%s'.\n", srcp, destp);
    6464
    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)
     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)
    7171                return EIO;
    7272
     
    8787
    8888        rc = vfs_put(df);
    89         if (rc < 0)
     89        if (rc != EOK)
    9090                return EIO;
    9191
     
    167167        struct stat st;
    168168
    169         sf = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ);
    170         if (sf < 0)
     169        rc = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ, &sf);
     170        if (rc != EOK)
    171171                return ENOENT;
    172172
Note: See TracChangeset for help on using the changeset viewer.