Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/bithenge/src/file.c

    r39330200 r8e3498b  
    6363}
    6464
    65 static errno_t file_size(bithenge_blob_t *base, aoff64_t *size)
     65static int file_size(bithenge_blob_t *base, aoff64_t *size)
    6666{
    6767        file_blob_t *blob = blob_as_file(base);
     
    7070}
    7171
    72 static errno_t file_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
     72static int file_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
    7373    aoff64_t *size)
    7474{
     
    7878
    7979        size_t amount_read;
    80         errno_t rc = vfs_read(blob->fd, &offset, buffer, *size, &amount_read);
     80        int rc = vfs_read(blob->fd, &offset, buffer, *size, &amount_read);
    8181        if (rc != EOK)
    8282                return errno;
     
    9898};
    9999
    100 static errno_t new_file_blob(bithenge_node_t **out, int fd, bool needs_close)
     100static int new_file_blob(bithenge_node_t **out, int fd, bool needs_close)
    101101{
    102102        assert(out);
    103103
    104         vfs_stat_t stat;
    105         errno_t rc = vfs_stat(fd, &stat);
     104        struct stat stat;
     105        int rc = vfs_stat(fd, &stat);
    106106        if (rc != EOK) {
    107107                if (needs_close)
     
    141141 * @param filename The name of the file.
    142142 * @return EOK on success or an error code from errno.h. */
    143 errno_t bithenge_new_file_blob(bithenge_node_t **out, const char *filename)
     143int bithenge_new_file_blob(bithenge_node_t **out, const char *filename)
    144144{
    145145        assert(filename);
    146146
    147         int fd;
    148         errno_t rc = vfs_lookup_open(filename, WALK_REGULAR, MODE_READ, &fd);
    149         if (rc != EOK)
    150                 return rc;
     147        int fd = vfs_lookup_open(filename, WALK_REGULAR, MODE_READ);
     148        if (fd < 0)
     149                return errno;
    151150
    152151        return new_file_blob(out, fd, true);
     
    158157 * @param fd The file descriptor.
    159158 * @return EOK on success or an error code from errno.h. */
    160 errno_t bithenge_new_file_blob_from_fd(bithenge_node_t **out, int fd)
     159int bithenge_new_file_blob_from_fd(bithenge_node_t **out, int fd)
    161160{
    162161        return new_file_blob(out, fd, false);
     
    168167 * @param file The file pointer.
    169168 * @return EOK on success or an error code from errno.h. */
    170 errno_t bithenge_new_file_blob_from_file(bithenge_node_t **out, FILE *file)
     169int bithenge_new_file_blob_from_file(bithenge_node_t **out, FILE *file)
    171170{
    172171        int fd = fileno(file);
Note: See TracChangeset for help on using the changeset viewer.