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


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

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

    r8bfb163 r132ab5d1  
    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.