Changes in uspace/lib/net/generic/packet_remote.c [0ab68f6:b69ceea] in mainline
- File:
-
- 1 edited
-
uspace/lib/net/generic/packet_remote.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/packet_remote.c
r0ab68f6 rb69ceea 38 38 #include <async.h> 39 39 #include <errno.h> 40 #include <err.h> 40 41 #include <ipc/ipc.h> 41 42 #include <ipc/packet.h> … … 66 67 packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size) 67 68 { 69 ERROR_DECLARE; 70 68 71 ipc_call_t answer; 69 aid_t message; 70 int rc; 71 72 message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer); 72 aid_t message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer); 73 73 74 74 *packet = (packet_t) as_get_mappable_page(size); 75 rc = async_share_in_start_0_0(phone, *packet, size);76 if (rc != EOK) {75 if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size)) || 76 ERROR_OCCURRED(pm_add(*packet))) { 77 77 munmap(*packet, size); 78 78 async_wait_for(message, NULL); 79 return rc; 80 } 81 rc = pm_add(*packet); 82 if (rc != EOK) { 83 munmap(*packet, size); 84 async_wait_for(message, NULL); 85 return rc; 79 return ERROR_CODE; 86 80 } 87 81 … … 109 103 int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id) 110 104 { 111 int rc;105 ERROR_DECLARE; 112 106 113 107 if (!packet) … … 118 112 ipcarg_t size; 119 113 120 rc = async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id, 121 &size); 122 if (rc != EOK) 123 return rc; 124 rc = packet_return(phone, packet, packet_id, size); 125 if (rc != EOK) 126 return rc; 114 ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE, 115 packet_id, &size)); 116 ERROR_PROPAGATE(packet_return(phone, packet, packet_id, size)); 127 117 } 128 118 if ((*packet)->next) { … … 151 141 size_t max_prefix, size_t max_suffix) 152 142 { 143 ERROR_DECLARE; 144 153 145 ipcarg_t packet_id; 154 146 ipcarg_t size; 155 int rc; 156 157 rc = async_req_4_2(phone, NET_PACKET_CREATE_4, max_content, addr_len, 158 max_prefix, max_suffix, &packet_id, &size); 159 if (rc != EOK) 147 148 if (ERROR_OCCURRED(async_req_4_2(phone, NET_PACKET_CREATE_4, 149 max_content, addr_len, max_prefix, max_suffix, &packet_id, &size))) 160 150 return NULL; 161 151 … … 163 153 packet_t packet = pm_find(packet_id); 164 154 if (!packet) { 165 rc = packet_return(phone, &packet, packet_id, size);166 if (rc != EOK)155 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, 156 size))) 167 157 return NULL; 168 158 } … … 182 172 packet_t packet_get_1_remote(int phone, size_t content) 183 173 { 174 ERROR_DECLARE; 175 184 176 ipcarg_t packet_id; 185 177 ipcarg_t size; 186 int rc; 187 188 rc = async_req_1_2(phone, NET_PACKET_CREATE_1, content, &packet_id, 189 &size); 190 if (rc != EOK) 178 179 if (ERROR_OCCURRED(async_req_1_2(phone, NET_PACKET_CREATE_1, content, 180 &packet_id, &size))) 191 181 return NULL; 192 182 193 183 packet_t packet = pm_find(packet_id); 194 184 if (!packet) { 195 rc = packet_return(phone, &packet, packet_id, size);196 if (rc != EOK)185 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, 186 size))) 197 187 return NULL; 198 188 }
Note:
See TracChangeset
for help on using the changeset viewer.
