Ignore:
File:
1 edited

Legend:

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

    rf77c1c9 rb7fd2a0  
    6363}
    6464
    65 static int file_size(bithenge_blob_t *base, aoff64_t *size)
     65static errno_t file_size(bithenge_blob_t *base, aoff64_t *size)
    6666{
    6767        file_blob_t *blob = blob_as_file(base);
     
    7070}
    7171
    72 static int file_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
     72static errno_t file_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
    7373    aoff64_t *size)
    7474{
     
    7878
    7979        size_t amount_read;
    80         int rc = vfs_read(blob->fd, &offset, buffer, *size, &amount_read);
     80        errno_t rc = vfs_read(blob->fd, &offset, buffer, *size, &amount_read);
    8181        if (rc != EOK)
    8282                return errno;
     
    9898};
    9999
    100 static int new_file_blob(bithenge_node_t **out, int fd, bool needs_close)
     100static errno_t new_file_blob(bithenge_node_t **out, int fd, bool needs_close)
    101101{
    102102        assert(out);
    103103
    104104        struct stat stat;
    105         int rc = vfs_stat(fd, &stat);
     105        errno_t 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 int bithenge_new_file_blob(bithenge_node_t **out, const char *filename)
     143errno_t bithenge_new_file_blob(bithenge_node_t **out, const char *filename)
    144144{
    145145        assert(filename);
    146146
    147147        int fd;
    148         int rc = vfs_lookup_open(filename, WALK_REGULAR, MODE_READ, &fd);
     148        errno_t rc = vfs_lookup_open(filename, WALK_REGULAR, MODE_READ, &fd);
    149149        if (rc != EOK)
    150150                return rc;
     
    158158 * @param fd The file descriptor.
    159159 * @return EOK on success or an error code from errno.h. */
    160 int bithenge_new_file_blob_from_fd(bithenge_node_t **out, int fd)
     160errno_t bithenge_new_file_blob_from_fd(bithenge_node_t **out, int fd)
    161161{
    162162        return new_file_blob(out, fd, false);
     
    168168 * @param file The file pointer.
    169169 * @return EOK on success or an error code from errno.h. */
    170 int bithenge_new_file_blob_from_file(bithenge_node_t **out, FILE *file)
     170errno_t bithenge_new_file_blob_from_file(bithenge_node_t **out, FILE *file)
    171171{
    172172        int fd = fileno(file);
Note: See TracChangeset for help on using the changeset viewer.