Changes in uspace/lib/c/generic/inet.c [77ad86c:50b581d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet.c
r77ad86c r50b581d 44 44 { 45 45 async_exch_t *exch = async_exchange_begin(inet_sess); 46 46 47 47 ipc_call_t answer; 48 48 aid_t req = async_send_0(exch, INET_CALLBACK_CREATE, &answer); 49 49 int rc = async_connect_to_me(exch, 0, 0, 0, inet_cb_conn, NULL); 50 50 async_exchange_end(exch); 51 51 52 52 if (rc != EOK) 53 53 return rc; 54 54 55 55 sysarg_t retval; 56 56 async_wait_for(req, &retval); 57 58 return retval; 57 if (retval != EOK) 58 return retval; 59 60 return EOK; 59 61 } 60 62 61 63 static int inet_set_proto(uint8_t protocol) 62 64 { 65 int rc; 66 63 67 async_exch_t *exch = async_exchange_begin(inet_sess); 64 intrc = async_req_1_0(exch, INET_SET_PROTO, protocol);68 rc = async_req_1_0(exch, INET_SET_PROTO, protocol); 65 69 async_exchange_end(exch); 66 70 67 71 return rc; 68 72 } … … 76 80 assert(inet_ev_ops == NULL); 77 81 assert(inet_protocol == 0); 78 82 79 83 rc = loc_service_get_id(SERVICE_NAME_INET, &inet_svc, 80 84 IPC_FLAG_BLOCKING); 81 85 if (rc != EOK) 82 86 return ENOENT; 83 87 84 88 inet_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc, 85 89 IPC_FLAG_BLOCKING); 86 90 if (inet_sess == NULL) 87 91 return ENOENT; 88 92 89 93 if (inet_set_proto(protocol) != EOK) { 90 94 async_hangup(inet_sess); … … 92 96 return EIO; 93 97 } 94 98 95 99 if (inet_callback_create() != EOK) { 96 100 async_hangup(inet_sess); … … 98 102 return EIO; 99 103 } 100 104 101 105 inet_protocol = protocol; 102 106 inet_ev_ops = ev_ops;
Note:
See TracChangeset
for help on using the changeset viewer.