Changes in uspace/lib/c/generic/net/modules.c [1bfd3d3:c7a8442] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/net/modules.c
r1bfd3d3 rc7a8442 41 41 #include <async.h> 42 42 #include <malloc.h> 43 #include <err no.h>43 #include <err.h> 44 44 #include <sys/time.h> 45 45 … … 137 137 ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout) 138 138 { 139 int rc;139 ERROR_DECLARE; 140 140 141 141 /* Connect to the needed service */ … … 144 144 /* Request the bidirectional connection */ 145 145 ipcarg_t phonehash; 146 147 rc = ipc_connect_to_me(phone, arg1, arg2, arg3, &phonehash); 148 if (rc != EOK) { 146 if (ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3, 147 &phonehash))) { 149 148 ipc_hangup(phone); 150 return rc;149 return ERROR_CODE; 151 150 } 152 151 async_new_connection(phonehash, 0, NULL, client_receiver); … … 159 158 * 160 159 * @param[in] need The needed module service. 161 * @return The phone of the needed service.160 * @returns The phone of the needed service. 162 161 */ 163 162 int connect_to_service(services_t need) … … 171 170 * @param[in] timeout The connection timeout in microseconds. No timeout if 172 171 * set to zero (0). 173 * @return The phone of the needed service.174 * @return ETIMEOUT if the connection timeouted.172 * @returns The phone of the needed service. 173 * @returns ETIMEOUT if the connection timeouted. 175 174 */ 176 175 int connect_to_service_timeout(services_t need, suseconds_t timeout) … … 204 203 * @param[out] data The data buffer to be filled. 205 204 * @param[out] length The buffer length. 206 * @return EOK on success.207 * @return EBADMEM if the data or the length parameter is NULL.208 * @return EINVAL if the client does not send data.209 * @return ENOMEM if there is not enough memory left.210 * @return Other error codes as defined for the205 * @returns EOK on success. 206 * @returns EBADMEM if the data or the length parameter is NULL. 207 * @returns EINVAL if the client does not send data. 208 * @returns ENOMEM if there is not enough memory left. 209 * @returns Other error codes as defined for the 211 210 * async_data_write_finalize() function. 212 211 */ 213 212 int data_receive(void **data, size_t *length) 214 213 { 214 ERROR_DECLARE; 215 215 216 ipc_callid_t callid; 216 int rc;217 217 218 218 if (!data || !length) … … 229 229 230 230 // fetch the data 231 rc = async_data_write_finalize(callid, *data, *length); 232 if (rc != EOK) { 231 if (ERROR_OCCURRED(async_data_write_finalize(callid, *data, *length))) { 233 232 free(data); 234 return rc;233 return ERROR_CODE; 235 234 } 236 235 … … 242 241 * @param[in] data The data buffer to be sent. 243 242 * @param[in] data_length The buffer length. 244 * @return EOK on success.245 * @return EINVAL if the client does not expect the data.246 * @return EOVERFLOW if the client does not expect all the data.243 * @returns EOK on success. 244 * @returns EINVAL if the client does not expect the data. 245 * @returns EOVERFLOW if the client does not expect all the data. 247 246 * Only partial data are transfered. 248 * @return Other error codes as defined for the247 * @returns Other error codes as defined for the 249 248 * async_data_read_finalize() function. 250 249 */
Note:
See TracChangeset
for help on using the changeset viewer.