Changeset 8fb1bf82 in mainline for uspace/lib/c/generic/net/modules.c


Ignore:
Timestamp:
2010-11-25T13:42:50Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8df8415
Parents:
a93d79a (diff), eb667613 (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 mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/modules.c

    ra93d79a r8fb1bf82  
    4141#include <async.h>
    4242#include <malloc.h>
    43 #include <err.h>
     43#include <errno.h>
    4444#include <sys/time.h>
    4545
     
    137137    ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout)
    138138{
    139         ERROR_DECLARE;
     139        int rc;
    140140       
    141141        /* Connect to the needed service */
     
    144144                /* Request the bidirectional connection */
    145145                ipcarg_t phonehash;
    146                 if (ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3,
    147                     &phonehash))) {
     146               
     147                rc = ipc_connect_to_me(phone, arg1, arg2, arg3, &phonehash);
     148                if (rc != EOK) {
    148149                        ipc_hangup(phone);
    149                         return ERROR_CODE;
     150                        return rc;
    150151                }
    151152                async_new_connection(phonehash, 0, NULL, client_receiver);
     
    158159 *
    159160 * @param[in] need      The needed module service.
    160  * @returns             The phone of the needed service.
     161 * @return              The phone of the needed service.
    161162 */
    162163int connect_to_service(services_t need)
     
    170171 *  @param[in] timeout  The connection timeout in microseconds. No timeout if
    171172 *                      set to zero (0).
    172  *  @returns            The phone of the needed service.
    173  *  @returns            ETIMEOUT if the connection timeouted.
     173 *  @return             The phone of the needed service.
     174 *  @return             ETIMEOUT if the connection timeouted.
    174175 */
    175176int connect_to_service_timeout(services_t need, suseconds_t timeout)
     
    203204 * @param[out] data     The data buffer to be filled.
    204205 * @param[out] length   The buffer length.
    205  * @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
     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 the
    210211 *                      async_data_write_finalize() function.
    211212 */
    212213int data_receive(void **data, size_t *length)
    213214{
    214         ERROR_DECLARE;
    215 
    216215        ipc_callid_t callid;
     216        int rc;
    217217
    218218        if (!data || !length)
     
    229229
    230230        // fetch the data
    231         if (ERROR_OCCURRED(async_data_write_finalize(callid, *data, *length))) {
     231        rc = async_data_write_finalize(callid, *data, *length);
     232        if (rc != EOK) {
    232233                free(data);
    233                 return ERROR_CODE;
     234                return rc;
    234235        }
    235236
     
    241242 * @param[in] data      The data buffer to be sent.
    242243 * @param[in] data_length The buffer length.
    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.
     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.
    246247 *                      Only partial data are transfered.
    247  * @returns             Other error codes as defined for the
     248 * @return              Other error codes as defined for the
    248249 *                      async_data_read_finalize() function.
    249250 */
Note: See TracChangeset for help on using the changeset viewer.