Changeset 9c4cf0d in mainline for uspace/app/bdsh/cmds/modules/cp/cp.c


Ignore:
Timestamp:
2017-04-02T11:24:06Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
151f1cc
Parents:
b19e892
Message:

Rename close() to vfs_put()

This is motivated mainly by the fact that a file handle does not
necessarily correspond to an open file and close() was no longer the
the opposite operation to open().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    rb19e892 r9c4cf0d  
    391391        if (fd2 < 0) {
    392392                printf("Unable to open destination file %s\n", dest);
    393                 close(fd1);
     393                vfs_put(fd1);
    394394                return -1;
    395395        }
     
    397397        if (vfs_stat(fd1, &st) != EOK) {
    398398                printf("Unable to fstat %d\n", fd1);
    399                 close(fd1);
    400                 close(fd2);
     399                vfs_put(fd1);
     400                vfs_put(fd2);
    401401                return -1;     
    402402        }
     
    425425
    426426out:
    427         close(fd1);
    428         close(fd2);
     427        vfs_put(fd1);
     428        vfs_put(fd2);
    429429        if (buff)
    430430                free(buff);
Note: See TracChangeset for help on using the changeset viewer.