Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 6afc9d7 in mainline for uspace/app/viewer/viewer.c


Ignore:
Timestamp:
2015-10-06T19:01:36Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
0328987
Parents:
f1f7584
Message:

UNIX-like I/O functions should use errno to return error code for many reasons.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/viewer/viewer.c

    rf1f7584 r6afc9d7  
    9898{
    9999        int fd = open(fname, O_RDONLY);
    100         if (fd < 0)
     100        if (fd != 0)
    101101                return false;
    102102       
    103103        struct stat stat;
    104104        int rc = fstat(fd, &stat);
    105         if (rc != EOK) {
     105        if (rc != 0) {
    106106                close(fd);
    107107                return false;
     
    114114        }
    115115       
    116         ssize_t rd = read_all(fd, tga, stat.size);
     116        ssize_t rd = read(fd, tga, stat.size);
    117117        if ((rd < 0) || (rd != (ssize_t) stat.size)) {
    118118                free(tga);
Note: See TracChangeset for help on using the changeset viewer.