Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision 42a9f27abc46056863f33053b659f04aaccaa036)
+++ uspace/lib/net/netif/netif_local.c	(revision 1d0d06ab3697bcf26d50afc7b5b9c7c80b9e0abc)
@@ -43,5 +43,5 @@
 #include <ipc/services.h>
 #include <ipc/netif.h>
-#include <err.h>
+#include <errno.h>
 
 #include <generic.h>
@@ -113,12 +113,13 @@
 int netif_start_req_local(int netif_phone, device_id_t device_id)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	fibril_rwlock_write_lock(&netif_globals.lock);
 	
 	netif_device_t *device;
-	if (ERROR_OCCURRED(find_device(device_id, &device))) {
+	rc = find_device(device_id, &device);
+	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -148,12 +149,13 @@
 int netif_stop_req_local(int netif_phone, device_id_t device_id)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	fibril_rwlock_write_lock(&netif_globals.lock);
 	
 	netif_device_t *device;
-	if (ERROR_OCCURRED(find_device(device_id, &device))) {
+	rc = find_device(device_id, &device);
+	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -203,5 +205,5 @@
     measured_string_ref *address, char **data)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	if (!address || !data)
@@ -211,7 +213,8 @@
 	
 	measured_string_t translation;
-	if (!ERROR_OCCURRED(netif_get_addr_message(device_id, &translation))) {
+	rc = netif_get_addr_message(device_id, &translation);
+	if (rc == EOK) {
 		*address = measured_string_copy(&translation);
-		ERROR_CODE = (*address) ? EOK : ENOMEM;
+		rc = (*address) ? EOK : ENOMEM;
 	}
 	
@@ -220,5 +223,5 @@
 	*data = (**address).value;
 	
-	return ERROR_CODE;
+	return rc;
 }
 
@@ -264,5 +267,5 @@
 int netif_init_module(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	async_set_client_connection(client_connection);
@@ -271,10 +274,14 @@
 	netif_device_map_initialize(&netif_globals.device_map);
 	
-	ERROR_PROPAGATE(pm_init());
+	rc = pm_init();
+	if (rc != EOK)
+		return rc;
 	
 	fibril_rwlock_initialize(&netif_globals.lock);
-	if (ERROR_OCCURRED(netif_initialize())) {
+	
+	rc = netif_initialize();
+	if (rc != EOK) {
 		pm_destroy();
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -317,9 +324,12 @@
 static int register_message(const char *name, device_id_t device_id, int phone)
 {
-	ERROR_DECLARE;
-	
 	netif_device_t *device;
-	ERROR_PROPAGATE(find_device(device_id, &device));
-	if(device->nil_phone > 0)
+	int rc;
+	
+	rc = find_device(device_id, &device);
+	if (rc != EOK)
+		return rc;
+	
+	if (device->nil_phone > 0)
 		return ELIMIT;
 	
@@ -349,10 +359,9 @@
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
-	ERROR_DECLARE;
-	
 	size_t length;
 	device_stats_t stats;
 	packet_t packet;
 	measured_string_t address;
+	int rc;
 	
 	*answer_count = 0;
@@ -367,15 +376,17 @@
 	case IPC_M_CONNECT_TO_ME:
 		fibril_rwlock_write_lock(&netif_globals.lock);
-		ERROR_CODE = register_message(name, IPC_GET_DEVICE(call),
+		rc = register_message(name, IPC_GET_DEVICE(call),
 		    IPC_GET_PHONE(call));
 		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 		
 	case NET_NETIF_SEND:
-		ERROR_PROPAGATE(packet_translate_remote(netif_globals.net_phone,
-		    &packet, IPC_GET_PACKET(call)));
+		rc = packet_translate_remote(netif_globals.net_phone, &packet,
+		    IPC_GET_PACKET(call));
+		if (rc != EOK)
+			return rc;
 		return netif_send_msg_local(0, IPC_GET_DEVICE(call), packet,
 		    IPC_GET_SENDER(call));
-		    
+		
 	case NET_NETIF_START:
 		return netif_start_req_local(0, IPC_GET_DEVICE(call));
@@ -384,7 +395,8 @@
 		fibril_rwlock_read_lock(&netif_globals.lock);
 
-		if (ERROR_OCCURRED(async_data_read_receive(&callid, &length))) {
+		rc = async_data_read_receive(&callid, &length);
+		if (rc != EOK) {
 			fibril_rwlock_read_unlock(&netif_globals.lock);
-			return ERROR_CODE;
+			return rc;
 		}
 		if (length < sizeof(device_stats_t)) {
@@ -393,12 +405,12 @@
 		}
 
-		if (ERROR_NONE(netif_get_device_stats(IPC_GET_DEVICE(call),
-		    &stats))) {
-			ERROR_CODE = async_data_read_finalize(callid, &stats,
+		rc = netif_get_device_stats(IPC_GET_DEVICE(call), &stats);
+		if (rc == EOK) {
+			rc = async_data_read_finalize(callid, &stats,
 			    sizeof(device_stats_t));
 		}
 
 		fibril_rwlock_read_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 
 	case NET_NETIF_STOP:
@@ -407,9 +419,9 @@
 	case NET_NETIF_GET_ADDR:
 		fibril_rwlock_read_lock(&netif_globals.lock);
-		if (ERROR_NONE(netif_get_addr_message(IPC_GET_DEVICE(call),
-		    &address)))
-			ERROR_CODE = measured_strings_reply(&address, 1);
+		rc = netif_get_addr_message(IPC_GET_DEVICE(call), &address);
+		if (rc == EOK)
+			rc = measured_strings_reply(&address, 1);
 		fibril_rwlock_read_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -431,7 +443,9 @@
 int netif_module_start_standalone(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
-	
-	ERROR_PROPAGATE(netif_init_module(client_connection));
+	int rc;
+	
+	rc = netif_init_module(client_connection);
+	if (rc != EOK)
+		return rc;
 	
 	async_manager();
