Changeset 677cad5 in mainline for uspace/lib/c/generic/io/chardev_srv.c
- Timestamp:
- 2017-11-20T20:29:03Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b2f542a
- Parents:
- 19ea61d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/chardev_srv.c
r19ea61d r677cad5 48 48 void *buf; 49 49 size_t size; 50 size_t nread; 50 51 int rc; 51 52 ipc_callid_t rcallid; … … 70 71 } 71 72 72 rc = srv->srvs->ops->read(srv, buf, size );73 if (rc <0) {73 rc = srv->srvs->ops->read(srv, buf, size, &nread); 74 if (rc != EOK && nread == 0) { 74 75 async_answer_0(rcallid, rc); 75 76 async_answer_0(callid, rc); … … 78 79 } 79 80 80 async_data_read_finalize(rcallid, buf, size);81 async_data_read_finalize(rcallid, buf, nread); 81 82 82 83 free(buf); 83 async_answer_2(callid, EOK, EOK, rc /* nread */);84 async_answer_2(callid, EOK, rc, nread); 84 85 } 85 86 … … 89 90 void *data; 90 91 size_t size; 92 size_t nwr; 91 93 int rc; 92 94 … … 102 104 } 103 105 104 rc = srv->srvs->ops->write(srv, data, size );106 rc = srv->srvs->ops->write(srv, data, size, &nwr); 105 107 free(data); 106 if (rc < 0)108 if (rc != EOK && nwr == 0) { 107 109 async_answer_0(callid, rc); 110 return; 111 } 108 112 109 async_answer_2(callid, EOK, EOK, rc /* nwritten */);113 async_answer_2(callid, EOK, rc, nwr); 110 114 } 111 115
Note:
See TracChangeset
for help on using the changeset viewer.