Changeset 2e236901 in mainline for uspace/srv/net/netif/lo/lo.c
- Timestamp:
- 2010-11-03T20:44:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 093c0a1
- Parents:
- b445803
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/netif/lo/lo.c
rb445803 r2e236901 37 37 #include <async.h> 38 38 #include <errno.h> 39 #include <err.h>40 39 #include <stdio.h> 41 40 #include <str.h> … … 83 82 int netif_get_device_stats(device_id_t device_id, device_stats_ref stats) 84 83 { 85 ERROR_DECLARE;86 87 84 netif_device_t *device; 85 int rc; 88 86 89 87 if (!stats) 90 88 return EBADMEM; 91 ERROR_PROPAGATE(find_device(device_id, &device)); 89 rc = find_device(device_id, &device); 90 if (rc != EOK) 91 return rc; 92 92 memcpy(stats, (device_stats_ref) device->specific, 93 93 sizeof(device_stats_t)); … … 164 164 int netif_probe_message(device_id_t device_id, int irq, uintptr_t io) 165 165 { 166 ERROR_DECLARE;167 168 166 netif_device_t *device; 167 int rc; 169 168 170 169 // create a new device 171 ERROR_PROPAGATE(create(device_id, &device)); 170 rc = create(device_id, &device); 171 if (rc != EOK) 172 return rc; 172 173 // print the settings 173 174 printf("%s: Device created (id: %d)\n", NAME, device->device_id); … … 177 178 int netif_send_message(device_id_t device_id, packet_t packet, services_t sender) 178 179 { 179 ERROR_DECLARE;180 181 180 netif_device_t *device; 182 181 size_t length; 183 182 packet_t next; 184 183 int phone; 185 186 ERROR_PROPAGATE(find_device(device_id, &device)); 184 int rc; 185 186 rc = find_device(device_id, &device); 187 if (rc != EOK) 188 return EOK; 187 189 if (device->state != NETIF_ACTIVE) { 188 190 netif_pq_release(packet_get_id(packet)); … … 259 261 int main(int argc, char *argv[]) 260 262 { 261 ERROR_DECLARE;263 int rc; 262 264 263 265 /* Start the module */ 264 ERROR_PROPAGATE(netif_module_start(netif_client_connection));265 return EOK;266 rc = netif_module_start(netif_client_connection); 267 return rc; 266 268 } 267 269
Note:
See TracChangeset
for help on using the changeset viewer.