Changeset e1e4192 in mainline for uspace/lib/c


Ignore:
Timestamp:
2012-06-03T20:45:58Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
90478727
Parents:
f7e69f5 (diff), 3123d2a (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

Location:
uspace/lib/c/generic
Files:
5 edited

Legend:

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

    rf7e69f5 re1e4192  
    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         if (retval != EOK)
    58                 return retval;
    59 
    60         return EOK;
     57       
     58        return retval;
    6159}
    6260
    6361static int inet_set_proto(uint8_t protocol)
    6462{
    65         int rc;
    66 
    6763        async_exch_t *exch = async_exchange_begin(inet_sess);
    68         rc = async_req_1_0(exch, INET_SET_PROTO, protocol);
     64        int rc = async_req_1_0(exch, INET_SET_PROTO, protocol);
    6965        async_exchange_end(exch);
    70 
     66       
    7167        return rc;
    7268}
     
    8076        assert(inet_ev_ops == NULL);
    8177        assert(inet_protocol == 0);
    82 
     78       
    8379        rc = loc_service_get_id(SERVICE_NAME_INET, &inet_svc,
    8480            IPC_FLAG_BLOCKING);
    8581        if (rc != EOK)
    8682                return ENOENT;
    87 
     83       
    8884        inet_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc,
    8985            IPC_FLAG_BLOCKING);
    9086        if (inet_sess == NULL)
    9187                return ENOENT;
    92 
     88       
    9389        if (inet_set_proto(protocol) != EOK) {
    9490                async_hangup(inet_sess);
     
    9692                return EIO;
    9793        }
    98 
     94       
    9995        if (inet_callback_create() != EOK) {
    10096                async_hangup(inet_sess);
     
    10298                return EIO;
    10399        }
    104 
     100       
    105101        inet_protocol = protocol;
    106102        inet_ev_ops = ev_ops;
  • uspace/lib/c/generic/inetcfg.c

    rf7e69f5 re1e4192  
    119119
    120120        assert(inetcfg_sess == NULL);
    121 
     121       
    122122        rc = loc_service_get_id(SERVICE_NAME_INETCFG, &inet_svc,
    123123            IPC_FLAG_BLOCKING);
    124124        if (rc != EOK)
    125125                return ENOENT;
    126 
     126       
    127127        inetcfg_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc,
    128128            IPC_FLAG_BLOCKING);
    129129        if (inetcfg_sess == NULL)
    130130                return ENOENT;
    131 
     131       
    132132        return EOK;
    133133}
  • uspace/lib/c/generic/inetping.c

    rf7e69f5 re1e4192  
    4949
    5050        assert(inetping_sess == NULL);
    51 
     51       
    5252        inetping_ev_ops = ev_ops;
    53 
     53       
    5454        rc = loc_service_get_id(SERVICE_NAME_INETPING, &inetping_svc,
    5555            IPC_FLAG_BLOCKING);
    5656        if (rc != EOK)
    5757                return ENOENT;
    58 
     58       
    5959        inetping_sess = loc_service_connect(EXCHANGE_SERIALIZE, inetping_svc,
    6060            IPC_FLAG_BLOCKING);
    6161        if (inetping_sess == NULL)
    6262                return ENOENT;
    63 
     63       
    6464        async_exch_t *exch = async_exchange_begin(inetping_sess);
    6565
    6666        rc = async_connect_to_me(exch, 0, 0, 0, inetping_cb_conn, NULL);
    6767        async_exchange_end(exch);
    68 
     68       
    6969        if (rc != EOK) {
    7070                async_hangup(inetping_sess);
     
    7272                return rc;
    7373        }
    74 
     74       
    7575        return EOK;
    7676}
  • uspace/lib/c/generic/iplink.c

    rf7e69f5 re1e4192  
    4949    iplink_t **riplink)
    5050{
    51         iplink_t *iplink = NULL;
    52         int rc;
    53 
    54         iplink = calloc(1, sizeof(iplink_t));
     51        iplink_t *iplink = calloc(1, sizeof(iplink_t));
    5552        if (iplink == NULL)
    5653                return ENOMEM;
    57 
     54       
    5855        iplink->sess = sess;
    5956        iplink->ev_ops = ev_ops;
    60 
     57       
    6158        async_exch_t *exch = async_exchange_begin(sess);
    62 
    63         rc = async_connect_to_me(exch, 0, 0, 0, iplink_cb_conn, iplink);
     59       
     60        int rc = async_connect_to_me(exch, 0, 0, 0, iplink_cb_conn, iplink);
    6461        async_exchange_end(exch);
    65 
     62       
    6663        if (rc != EOK)
    6764                goto error;
    68 
     65       
    6966        *riplink = iplink;
    7067        return EOK;
    71 
     68       
    7269error:
    7370        if (iplink != NULL)
    7471                free(iplink);
    75 
     72       
    7673        return rc;
    7774}
  • uspace/lib/c/generic/net/socket_client.c

    rf7e69f5 re1e4192  
    283283static async_sess_t *socket_get_tcp_sess(void)
    284284{
    285         if (socket_globals.tcp_sess == NULL) {
     285        if (socket_globals.tcp_sess == NULL)
    286286                socket_globals.tcp_sess = service_bind(SERVICE_TCP,
    287287                    0, 0, SERVICE_TCP, socket_connection);
    288         }
    289 
     288       
    290289        return socket_globals.tcp_sess;
    291290}
     
    300299static async_sess_t *socket_get_udp_sess(void)
    301300{
    302         if (socket_globals.udp_sess == NULL) {
     301        if (socket_globals.udp_sess == NULL)
    303302                socket_globals.udp_sess = service_bind(SERVICE_UDP,
    304303                    0, 0, SERVICE_UDP, socket_connection);
    305         }
    306 
     304       
    307305        return socket_globals.udp_sess;
    308306}
Note: See TracChangeset for help on using the changeset viewer.