Ignore:
Timestamp:
2017-04-02T11:24:06Z (7 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/cat/cat.c

    rb19e892 r9c4cf0d  
    203203
    204204        if (NULL == (buff = (char *) malloc(blen + 1))) {
    205                 close(fd);
     205                vfs_put(fd);
    206206                printf("Unable to allocate enough memory to read %s\n",
    207207                    fname);
     
    213213
    214214                if (vfs_stat(fd, &st) != EOK) {
    215                         close(fd);
     215                        vfs_put(fd);
    216216                        free(buff);
    217217                        printf("Unable to vfs_stat %d\n", fd);
     
    287287        } while (bytes > 0 && !should_quit && (count < length || length == CAT_FULL_FILE));
    288288
    289         close(fd);
     289        vfs_put(fd);
    290290        if (bytes == -1) {
    291291                printf("Error reading %s\n", fname);
Note: See TracChangeset for help on using the changeset viewer.