Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/inet.c

    r77ad86c r50b581d  
    4444{
    4545        async_exch_t *exch = async_exchange_begin(inet_sess);
    46        
     46
    4747        ipc_call_t answer;
    4848        aid_t req = async_send_0(exch, INET_CALLBACK_CREATE, &answer);
    4949        int rc = async_connect_to_me(exch, 0, 0, 0, inet_cb_conn, NULL);
    5050        async_exchange_end(exch);
    51        
     51
    5252        if (rc != EOK)
    5353                return rc;
    54        
     54
    5555        sysarg_t retval;
    5656        async_wait_for(req, &retval);
    57        
    58         return retval;
     57        if (retval != EOK)
     58                return retval;
     59
     60        return EOK;
    5961}
    6062
    6163static int inet_set_proto(uint8_t protocol)
    6264{
     65        int rc;
     66
    6367        async_exch_t *exch = async_exchange_begin(inet_sess);
    64         int rc = async_req_1_0(exch, INET_SET_PROTO, protocol);
     68        rc = async_req_1_0(exch, INET_SET_PROTO, protocol);
    6569        async_exchange_end(exch);
    66        
     70
    6771        return rc;
    6872}
     
    7680        assert(inet_ev_ops == NULL);
    7781        assert(inet_protocol == 0);
    78        
     82
    7983        rc = loc_service_get_id(SERVICE_NAME_INET, &inet_svc,
    8084            IPC_FLAG_BLOCKING);
    8185        if (rc != EOK)
    8286                return ENOENT;
    83        
     87
    8488        inet_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc,
    8589            IPC_FLAG_BLOCKING);
    8690        if (inet_sess == NULL)
    8791                return ENOENT;
    88        
     92
    8993        if (inet_set_proto(protocol) != EOK) {
    9094                async_hangup(inet_sess);
     
    9296                return EIO;
    9397        }
    94        
     98
    9599        if (inet_callback_create() != EOK) {
    96100                async_hangup(inet_sess);
     
    98102                return EIO;
    99103        }
    100        
     104
    101105        inet_protocol = protocol;
    102106        inet_ev_ops = ev_ops;
Note: See TracChangeset for help on using the changeset viewer.