Changeset 46577995 in mainline for uspace/lib/c/generic/io/io.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/io.c

    rfacacc71 r46577995  
    297297                flags |= WALK_MAY_CREATE;
    298298        int file;
    299         int rc = vfs_lookup(path, flags, &file);
     299        errno_t rc = vfs_lookup(path, flags, &file);
    300300        if (rc != EOK) {
    301301                errno = rc;
     
    364364static int _fclose_nofree(FILE *stream)
    365365{
    366         int rc = 0;
     366        errno_t rc = 0;
    367367       
    368368        fflush(stream);
     
    433433static size_t _fread(void *buf, size_t size, size_t nmemb, FILE *stream)
    434434{
    435         int rc;
     435        errno_t rc;
    436436        size_t nread;
    437437
     
    462462static size_t _fwrite(const void *buf, size_t size, size_t nmemb, FILE *stream)
    463463{
    464         int rc;
     464        errno_t rc;
    465465        size_t nwritten;
    466466
     
    495495static void _ffillbuf(FILE *stream)
    496496{
    497         int rc;
     497        errno_t rc;
    498498        size_t nread;
    499499
     
    801801int fseek(FILE *stream, long offset, int whence)
    802802{
    803         int rc;
     803        errno_t rc;
    804804
    805805        if (stream->error)
     
    877877       
    878878        if ((stream->fd >= 0) && (stream->need_sync)) {
    879                 int rc;
     879                errno_t rc;
    880880
    881881                /**
     
    934934}
    935935
    936 int vfs_fhandle(FILE *stream, int *handle)
     936errno_t vfs_fhandle(FILE *stream, int *handle)
    937937{
    938938        if (stream->fd >= 0) {
Note: See TracChangeset for help on using the changeset viewer.