Changeset c8211849 in mainline for uspace/lib/c/generic/io/con_srv.c


Ignore:
Timestamp:
2017-12-08T21:03:35Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a99cbc1e
Parents:
c19a5a59
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 23:08:49)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:03:35)
Message:

Return number of characters separately from error code in console IO.

File:
1 edited

Legend:

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

    rc19a5a59 rc8211849  
    9393        }
    9494
    95         rc = srv->srvs->ops->read(srv, buf, size);
    96         if (rc < 0) {
     95        size_t nread;
     96        rc = srv->srvs->ops->read(srv, buf, size, &nread);
     97        if (rc != EOK) {
    9798                async_answer_0(rcallid, rc);
    9899                async_answer_0(callid, rc);
     
    101102        }
    102103
    103         async_data_read_finalize(rcallid, buf, size);
     104        async_data_read_finalize(rcallid, buf, nread);
    104105        free(buf);
    105106
    106         if (rc >= 0)
    107                 async_answer_1(callid, EOK, rc);
    108         else
    109                 async_answer_0(callid, rc);
     107        async_answer_1(callid, EOK, nread);
    110108}
    111109
     
    128126        }
    129127
    130         rc = srv->srvs->ops->write(srv, data, size);
     128        size_t nwritten = 0;
     129        rc = srv->srvs->ops->write(srv, data, size, &nwritten);
    131130        free(data);
    132131
    133         if (rc >= 0)
    134                 async_answer_1(callid, EOK, rc);
    135         else
    136                 async_answer_0(callid, rc);
     132        async_answer_1(callid, rc, nwritten);
    137133}
    138134
Note: See TracChangeset for help on using the changeset viewer.