Index: uspace/app/bdsh/scli.c
===================================================================
--- uspace/app/bdsh/scli.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/bdsh/scli.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -120,4 +120,4 @@
 
 	cli_finit(&usr);
-	return ret;
+	return EXIT_RC(ret);
 }
Index: uspace/app/corecfg/corecfg.c
===================================================================
--- uspace/app/corecfg/corecfg.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/corecfg/corecfg.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -36,4 +36,5 @@
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #define NAME "corecfg"
@@ -76,7 +77,7 @@
 		return corecfg_print();
 	else if (str_cmp(argv[1], "enable") == 0)
-		return corecfg_set_enable(true);
+		return EXIT_RC(corecfg_set_enable(true));
 	else if (str_cmp(argv[1], "disable") == 0)
-		return corecfg_set_enable(false);
+		return EXIT_RC(corecfg_set_enable(false));
 	else {
 		printf("%s: Unknown command '%s'.\n", NAME, argv[1]);
Index: uspace/app/date/date.c
===================================================================
--- uspace/app/date/date.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/date/date.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -191,5 +191,5 @@
 	free(svc_name);
 	free(svc_ids);
-	return rc;
+	return EXIT_RC(rc);
 }
 
Index: uspace/app/dnscfg/dnscfg.c
===================================================================
--- uspace/app/dnscfg/dnscfg.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/dnscfg/dnscfg.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -128,9 +128,9 @@
 {
 	if ((argc < 2) || (str_cmp(argv[1], "get-ns") == 0))
-		return dnscfg_print();
+		return EXIT_RC(dnscfg_print());
 	else if (str_cmp(argv[1], "set-ns") == 0)
-		return dnscfg_set_ns(argc - 2, argv + 2);
+		return EXIT_RC(dnscfg_set_ns(argc - 2, argv + 2));
 	else if (str_cmp(argv[1], "unset-ns") == 0)
-		return dnscfg_unset_ns();
+		return EXIT_RC(dnscfg_unset_ns());
 	else {
 		printf("%s: Unknown command '%s'.\n", NAME, argv[1]);
Index: uspace/app/dnsres/dnsres.c
===================================================================
--- uspace/app/dnsres/dnsres.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/dnsres/dnsres.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -81,5 +81,5 @@
 	if (rc != EOK) {
 		printf("%s: Error resolving '%s'.\n", NAME, hname);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -89,5 +89,5 @@
 		dnsr_hostinfo_destroy(hinfo);
 		printf("%s: Error formatting address.\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/app/download/main.c
===================================================================
--- uspace/app/download/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/download/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -240,8 +240,8 @@
 	if (ofile != NULL && fclose(ofile) != 0) {
 		printf("Error writing '%s'.\n", ofname);
-		return EIO;
-	}
-
-	return EOK;
+		return EXIT_RC(EIO);
+	}
+
+	return 0;
 error:
 	free(buf);
@@ -252,5 +252,5 @@
 	if (ofile != NULL)
 		fclose(ofile);
-	return rc;
+	return EXIT_RC(rc);
 }
 
Index: uspace/app/getterm/getterm.c
===================================================================
--- uspace/app/getterm/getterm.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/getterm/getterm.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -37,4 +37,5 @@
 #include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 #include <str_error.h>
@@ -137,5 +138,5 @@
 			printf("%s: Error waiting on %s (%s)\n", APP_NAME, term,
 			    str_error(rc));
-			return rc;
+			return EXIT_RC(rc);
 		}
 	}
@@ -174,5 +175,5 @@
 		printf("%s: Error spawning %s (%s)\n", APP_NAME, cmd,
 		    str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -183,5 +184,5 @@
 		printf("%s: Error waiting for %s (%s)\n", APP_NAME, cmd,
 		    str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/app/kio/kio.c
===================================================================
--- uspace/app/kio/kio.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/kio/kio.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -191,5 +191,5 @@
 		fprintf(stderr, "%s: Unable to get number of kio pages\n",
 		    NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -199,5 +199,5 @@
 		fprintf(stderr, "%s: Unable to get kio physical address\n",
 		    NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -209,5 +209,5 @@
 	if (rc != EOK) {
 		fprintf(stderr, "%s: Unable to map kio\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -217,5 +217,5 @@
 		fprintf(stderr, "%s: Unable to register kio notifications\n",
 		    NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -224,5 +224,5 @@
 		fprintf(stderr, "%s: Unable to create consumer fibril\n",
 		    NAME);
-		return ENOMEM;
+		return EXIT_RC(ENOMEM);
 	}
 	
@@ -230,5 +230,5 @@
 	if (!input) {
 		fprintf(stderr, "%s: Could not create input\n", NAME);
-		return ENOMEM;
+		return EXIT_RC(ENOMEM);
 	}
 
@@ -253,5 +253,5 @@
 		rc = EOK;
 
-	return EOK;
+	return EXIT_RC(rc);
 }
 
Index: uspace/app/mkbd/main.c
===================================================================
--- uspace/app/mkbd/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/mkbd/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -222,5 +222,5 @@
 		printf("Device not found or not of USB kind: %s.\n",
 		    str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -229,5 +229,5 @@
 		printf(NAME ": failed to connect to the device (handle %"
 		       PRIun "): %s.\n", dev_handle, str_error(errno));
-		return errno;
+		return EXIT_RC(errno);
 	}
 	
@@ -239,5 +239,5 @@
 		printf(NAME ": failed to get path (handle %"
 		       PRIun "): %s.\n", dev_handle, str_error(errno));
-		return ENOMEM;
+		return EXIT_RC(ENOMEM);
 	}
 	
@@ -250,5 +250,5 @@
 		printf("Failed to initialize report parser: %s\n",
 		    str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -259,5 +259,5 @@
 	if (rc != EOK) {
 		printf("Failed to get event length: %s.\n", str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -266,5 +266,5 @@
 		printf("Out of memory.\n");
 		// TODO: hangup phone?
-		return ENOMEM;
+		return EXIT_RC(ENOMEM);
 	}
 	
Index: uspace/app/nic/nic.c
===================================================================
--- uspace/app/nic/nic.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/nic/nic.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -413,5 +413,6 @@
 	async_sess_t *sess;
 	nic_address_t addr;
-	int rc, idx;
+	int rc;
+	int idx;
 
 	sess = get_nic_by_index(i);
@@ -543,23 +544,23 @@
 
 		if (!str_cmp(argv[2], "addr"))
-			return nic_set_addr(index, argv[3]);
+			return EXIT_RC(nic_set_addr(index, argv[3]));
 
 		if (!str_cmp(argv[2], "speed"))
-			return nic_set_speed(index, argv[3]);
+			return EXIT_RC(nic_set_speed(index, argv[3]));
 
 		if (!str_cmp(argv[2], "duplex"))
-			return nic_set_duplex(index, argv[3]);
+			return EXIT_RC(nic_set_duplex(index, argv[3]));
 
 		if (!str_cmp(argv[2], "auto"))
-			return nic_set_autoneg(index);
+			return EXIT_RC(nic_set_autoneg(index));
 
 		if (!str_cmp(argv[2], "unicast"))
-			return nic_set_rx_unicast(index, argv[3]);
+			return EXIT_RC(nic_set_rx_unicast(index, argv[3]));
 
 		if (!str_cmp(argv[2], "multicast"))
-			return nic_set_rx_multicast(index, argv[3]);
+			return EXIT_RC(nic_set_rx_multicast(index, argv[3]));
 
 		if (!str_cmp(argv[2], "broadcast"))
-			return nic_set_rx_broadcast(index, argv[3]);
+			return EXIT_RC(nic_set_rx_broadcast(index, argv[3]));
 
 	} else {
Index: uspace/app/sysinfo/sysinfo.c
===================================================================
--- uspace/app/sysinfo/sysinfo.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/sysinfo/sysinfo.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -90,5 +90,5 @@
 	fputs("')\n", stdout);
 	
-	return EOK;
+	return 0;
 }
 
@@ -109,5 +109,5 @@
 	fputs("')\n", stdout);
 	
-	return EOK;
+	return 0;
 }
 
@@ -182,5 +182,5 @@
 			break;
 		case SYSINFO_VAL_VAL:
-			rc = print_item_val(ipath);
+			rc = EXIT_RC(print_item_val(ipath));
 			break;
 		case SYSINFO_VAL_DATA:
Index: uspace/app/sysinst/sysinst.c
===================================================================
--- uspace/app/sysinst/sysinst.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/sysinst/sysinst.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -387,5 +387,5 @@
 {
 	const char *dev = DEFAULT_DEV;
-	return sysinst_install(dev);
+	return EXIT_RC(sysinst_install(dev));
 }
 
Index: uspace/app/vuhid/main.c
===================================================================
--- uspace/app/vuhid/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/vuhid/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -238,5 +238,5 @@
 		printf("Unable to start communication with VHCD `%s': %s.\n",
 		    controller, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/app/websrv/websrv.c
===================================================================
--- uspace/app/websrv/websrv.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/websrv/websrv.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -450,8 +450,8 @@
 			rc = parse_option(argc, argv, &i);
 			if (rc != EOK)
-				return rc;
+				return EXIT_RC(rc);
 		} else {
 			usage();
-			return EINVAL;
+			return EXIT_RC(EINVAL);
 		}
 	}
Index: uspace/app/wifi_supplicant/wifi_supplicant.c
===================================================================
--- uspace/app/wifi_supplicant/wifi_supplicant.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/app/wifi_supplicant/wifi_supplicant.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -293,5 +293,5 @@
 	if (argc == 2) {
 		if (!str_cmp(argv[1], "list"))
-			return wifi_list();
+			return EXIT_RC(wifi_list());
 	} else if (argc > 2) {
 		uint32_t index;
@@ -300,5 +300,5 @@
 			printf("%s: Invalid argument.\n", NAME);
 			print_syntax();
-			return EINVAL;
+			return EXIT_RC(EINVAL);
 		}
 		
@@ -309,5 +309,5 @@
 					now = true;
 			
-			return wifi_scan(index, now);
+			return EXIT_RC(wifi_scan(index, now));
 		} else if (!str_cmp(argv[1], "connect")) {
 			char *pass = NULL;
@@ -316,13 +316,13 @@
 					pass = argv[4];
 				
-				return wifi_connect(index, argv[3], pass);
+				return EXIT_RC(wifi_connect(index, argv[3], pass));
 			}
 		} else if (!str_cmp(argv[1], "disconnect"))
-			return wifi_disconnect(index);
+			return EXIT_RC(wifi_disconnect(index));
 	}
 	
 	print_syntax();
 	
-	return EOK;
+	return 0;
 }
 
Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/drv/nic/rtl8139/driver.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -2145,5 +2145,5 @@
 	int rc = nic_driver_init(NAME);
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 
 	nic_driver_implement(&rtl8139_driver_ops, &rtl8139_dev_ops,
Index: uspace/drv/nic/rtl8169/driver.c
===================================================================
--- uspace/drv/nic/rtl8169/driver.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/drv/nic/rtl8169/driver.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -1210,5 +1210,5 @@
 	int rc = nic_driver_init(NAME);
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	nic_driver_implement(
 		&rtl8169_driver_ops, &rtl8169_dev_ops, &rtl8169_nic_iface);
Index: uspace/lib/c/include/stdlib.h
===================================================================
--- uspace/lib/c/include/stdlib.h	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/lib/c/include/stdlib.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -51,4 +51,12 @@
 extern void exit(int) __attribute__((noreturn));
 
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE -1
+
+#include <errno.h>
+static inline int EXIT_RC(errno_t rc) {
+	return (int) rc;
+}
+
 #endif
 
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/lib/drv/generic/driver.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -978,5 +978,5 @@
 	if (rc != EOK) {
 		printf("Error: Failed to create driver port.\n");
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -985,5 +985,5 @@
 	if (rc != EOK) {
 		printf("Error: Failed to create devman port.\n");
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -996,5 +996,5 @@
 		    str_error(rc));
 		
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -1003,5 +1003,5 @@
 	if (rc != EOK) {
 		printf("Error: Failed returning task value.\n");
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -1009,5 +1009,5 @@
 	
 	/* Never reached. */
-	return EOK;
+	return 0;
 }
 
Index: uspace/srv/audio/hound/main.c
===================================================================
--- uspace/srv/audio/hound/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/audio/hound/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -80,5 +80,5 @@
 		log_fatal("Failed to initialize hound structure: %s",
 		    str_error(ret));
-		return -ret;
+		return EXIT_RC(ret);
 	}
 
@@ -91,5 +91,5 @@
 	if (ret != EOK) {
 		log_fatal("Failed to register server: %s", str_error(ret));
-		return -ret;
+		return EXIT_RC(ret);
 	}
 
@@ -99,5 +99,5 @@
 		    str_error(ret));
 		hound_server_unregister(id);
-		return -ret;
+		return EXIT_RC(ret);
 	}
 	log_info("Running with service id %" PRIun, id);
Index: uspace/srv/bd/file_bd/file_bd.c
===================================================================
--- uspace/srv/bd/file_bd/file_bd.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/bd/file_bd/file_bd.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -47,4 +47,5 @@
 #include <stddef.h>
 #include <stdint.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <str_error.h>
@@ -137,5 +138,5 @@
 		printf("%s: Unable to register device '%s': %s.\n",
 		    NAME, device_name, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -143,5 +144,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed resolving category 'disk': %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -150,5 +151,5 @@
 		printf("%s: Failed adding %s to category: %s",
 		    NAME, device_name, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
Index: uspace/srv/bd/sata_bd/sata_bd.c
===================================================================
--- uspace/srv/bd/sata_bd/sata_bd.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/bd/sata_bd/sata_bd.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -253,11 +253,11 @@
 	if (rc != EOK) {
 		printf(NAME ": Unable to register driver: %s.\n", str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
 	rc = get_sata_disks();
 	if (rc != EOK) {
-		// TODO: log the error
-		return rc;
+		printf(NAME ": Cannot find SATA disks: %s.\n", str_error(rc));
+		return EXIT_RC(rc);
 	}
 
@@ -265,5 +265,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed resolving category 'disk': %s.\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -274,5 +274,5 @@
 		if (rc != EOK) {
 			printf(NAME ": Unable to register device %s: %s\n", name, str_error(rc));
-			return rc;
+			return EXIT_RC(rc);
 		}
 
@@ -281,5 +281,5 @@
 			printf("%s: Failed adding %s to category: %s.",
 			    NAME, disk[i].dev_name, str_error(rc));
-			return rc;
+			return EXIT_RC(rc);
 		}
 	}
Index: uspace/srv/clipboard/clipboard.c
===================================================================
--- uspace/srv/clipboard/clipboard.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/clipboard/clipboard.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -190,5 +190,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed registering server: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -196,5 +196,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed registering service : %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/devman/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -320,5 +320,5 @@
 	if (rc != EOK) {
 		printf("%s: Error initializing logging subsystem: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -332,5 +332,5 @@
 	if (rc != EOK) {
 		printf("%s: Error creating DDF driver port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -339,5 +339,5 @@
 	if (rc != EOK) {
 		printf("%s: Error creating DDF client port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -346,5 +346,5 @@
 	if (rc != EOK) {
 		printf("%s: Error creating devman device port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -353,5 +353,5 @@
 	if (rc != EOK) {
 		printf("%s: Error creating devman parent port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -367,5 +367,5 @@
 	if (rc != EOK) {
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering as a service: %s", str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/fs/cdfs/cdfs.c
===================================================================
--- uspace/srv/fs/cdfs/cdfs.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/cdfs/cdfs.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -43,4 +43,5 @@
 #include <str_error.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <libfs.h>
 #include "cdfs.h"
@@ -85,5 +86,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed to register file system: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/fs/exfat/exfat.c
===================================================================
--- uspace/srv/fs/exfat/exfat.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/exfat/exfat.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -46,4 +46,5 @@
 #include <task.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <libfs.h>
 #include "../../vfs/vfs.h"
@@ -97,5 +98,5 @@
 err:
 	printf(NAME ": Failed to register file system: %s\n", str_error(rc));
-	return rc;
+	return EXIT_RC(rc);
 }
 
Index: uspace/srv/fs/ext4fs/ext4fs.c
===================================================================
--- uspace/srv/fs/ext4fs/ext4fs.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/ext4fs/ext4fs.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -40,4 +40,5 @@
 #include <ns.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 #include <ipc/services.h>
@@ -75,5 +76,5 @@
 	if (rc != EOK) {
 		printf("%s: Global initialization failed\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -82,5 +83,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed to register file system\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/fs/fat/fat.c
===================================================================
--- uspace/srv/fs/fat/fat.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/fat/fat.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -46,4 +46,5 @@
 #include <task.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <libfs.h>
 #include "../../vfs/vfs.h"
@@ -97,5 +98,5 @@
 err:
 	printf(NAME ": Failed to register file system: %s\n", str_error(rc));
-	return rc;
+	return EXIT_RC(rc);
 }
 
Index: uspace/srv/fs/locfs/locfs.c
===================================================================
--- uspace/srv/fs/locfs/locfs.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/locfs/locfs.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -40,4 +40,5 @@
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <ipc/services.h>
 #include <ns.h>
@@ -89,5 +90,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed to register file system: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/fs/mfs/mfs.c
===================================================================
--- uspace/srv/fs/mfs/mfs.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/mfs/mfs.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -100,5 +100,5 @@
 err:
 	printf(NAME ": Failed to register file system: %s\n", str_error(rc));
-	return rc;
+	return EXIT_RC(rc);
 }
 
Index: uspace/srv/fs/tmpfs/tmpfs.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/tmpfs/tmpfs.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -48,4 +48,5 @@
 #include <str_error.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 #include <libfs.h>
@@ -91,5 +92,5 @@
 	if (rc != EOK) {
 		printf(NAME ": Failed to register file system: %s\n", str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/fs/udf/udf.c
===================================================================
--- uspace/srv/fs/udf/udf.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/fs/udf/udf.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -42,4 +42,5 @@
 #include <errno.h>
 #include <str_error.h>
+#include <stdlib.h>
 #include <task.h>
 #include <libfs.h>
@@ -98,5 +99,5 @@
 err:
 	log_msg(LOG_DEFAULT, LVL_FATAL, "Failed to register file system: %s", str_error(rc));
-	return rc;
+	return EXIT_RC(rc);
 }
 
Index: uspace/srv/hid/compositor/compositor.c
===================================================================
--- uspace/srv/hid/compositor/compositor.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hid/compositor/compositor.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -2254,5 +2254,5 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register server (%s)\n", NAME, str_error(rc));
-		return -1;
+		return rc;
 	}
 	
@@ -2272,7 +2272,8 @@
 	char winreg[LOC_NAME_MAXLEN + 1];
 	snprintf(winreg, LOC_NAME_MAXLEN, "%s%s/winreg", NAMESPACE, server_name);
-	if (loc_service_register(winreg, &winreg_id) != EOK) {
+	rc = loc_service_register(winreg, &winreg_id);
+	if (rc != EOK) {
 		printf("%s: Unable to register service %s\n", NAME, winreg);
-		return -1;
+		return rc;
 	}
 	
@@ -2315,5 +2316,5 @@
 	int rc = compositor_srv_init(argv[1], argv[2]);
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	
 	printf("%s: Accepting connections\n", NAME);
Index: uspace/srv/hid/input/input.c
===================================================================
--- uspace/srv/hid/input/input.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hid/input/input.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -869,5 +869,5 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register server\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -876,5 +876,5 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register service %s\n", NAME, argv[1]);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/hid/isdv4_tablet/main.c
===================================================================
--- uspace/srv/hid/isdv4_tablet/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hid/isdv4_tablet/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -315,13 +315,12 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register driver.\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
 	service_id_t service_id;
 	char *service_name;
-	rc = asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id);
-	if (rc < 0) {
+	if (asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id) < 0) {
 		printf(NAME ": Unable to create service name\n");
-		return rc;
+		return EXIT_RC(ENOMEM);
 	}
 
@@ -329,5 +328,5 @@
 	if (rc != EOK) {
 		printf(NAME ": Unable to register service %s.\n", service_name);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
Index: uspace/srv/hid/output/output.c
===================================================================
--- uspace/srv/hid/output/output.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hid/output/output.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -470,5 +470,5 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register driver\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -477,5 +477,5 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register service %s\n", NAME, argv[1]);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/hid/remcons/remcons.c
===================================================================
--- uspace/srv/hid/remcons/remcons.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hid/remcons/remcons.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -353,5 +353,5 @@
 	if (rc != EOK) {
 		fprintf(stderr, "%s: Unable to register server\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -359,5 +359,5 @@
 	if (rc != EOK) {
 		fprintf(stderr, "%s: Error initializing TCP.\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -369,5 +369,5 @@
 	if (rc != EOK) {
 		fprintf(stderr, "%s: Error creating listener.\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
Index: uspace/srv/hid/rfb/main.c
===================================================================
--- uspace/srv/hid/rfb/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hid/rfb/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -220,12 +220,11 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register server.\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
 	char *service_name;
-	rc = asprintf(&service_name, "rfb/%s", rfb_name);
-	if (rc < 0) {
+	if (asprintf(&service_name, "rfb/%s", rfb_name) < 0) {
 		printf(NAME ": Unable to create service name\n");
-		return rc;
+		return EXIT_RC(ENOMEM);
 	}
 
@@ -235,5 +234,5 @@
 	if (rc != EOK) {
 		printf(NAME ": Unable to register service %s.\n", service_name);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -88,5 +88,5 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register driver.\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -95,5 +95,5 @@
 		return -1;
 
-	if (s3c24xx_ts_init(ts) != EOK)
+	if (s3c24xx_ts_init(ts) != 0)
 		return -1;
 
@@ -141,5 +141,5 @@
 	s3c24xx_ts_wait_for_int_mode(ts, updn_down);
 
-	return EOK;
+	return 0;
 }
 
Index: uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
===================================================================
--- uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -85,5 +85,5 @@
 	if (rc != EOK) {
 		printf("%s: Unable to register server.\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -92,5 +92,5 @@
 		return -1;
 
-	if (s3c24xx_uart_init(uart) != EOK)
+	if (s3c24xx_uart_init(uart) != 0)
 		return -1;
 
@@ -187,5 +187,5 @@
 	uart->cds.sarg = uart;
 
-	return EOK;
+	return 0;
 }
 
Index: uspace/srv/klog/klog.c
===================================================================
--- uspace/srv/klog/klog.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/klog/klog.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -213,5 +213,5 @@
 	if (rc != EOK) {
 		fprintf(stderr, "%s: Unable to initialize log\n", NAME);
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -232,5 +232,5 @@
 		log_msg(LOG_DEFAULT, LVL_ERROR,
 		    "Unable to register klog notifications");
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -239,5 +239,5 @@
 		log_msg(LOG_DEFAULT, LVL_ERROR,
 		    "Unable to create consumer fibril");
-		return ENOMEM;
+		return EXIT_RC(ENOMEM);
 	}
 	
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/loader/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -397,5 +397,5 @@
 	int rc = ns_intro(id);
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	
 	/* Create port */
@@ -403,10 +403,10 @@
 	rc = async_create_port(INTERFACE_LOADER, ldr_connection, NULL, &port);
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	
 	/* Register at naming service. */
 	rc = service_register(SERVICE_LOADER);
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	
 	async_manager();
Index: uspace/srv/locsrv/locsrv.c
===================================================================
--- uspace/srv/locsrv/locsrv.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/locsrv/locsrv.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -1532,5 +1532,5 @@
 	if (rc != EOK) {
 		printf("%s: Error while creating supplier port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -1539,5 +1539,5 @@
 	if (rc != EOK) {
 		printf("%s: Error while creating consumer port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -1549,5 +1549,5 @@
 	if (rc != EOK) {
 		printf("%s: Error while registering service: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/logger/main.c
===================================================================
--- uspace/srv/logger/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/logger/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -74,5 +74,5 @@
 	if (rc != EOK) {
 		printf("%s: Error while creating control port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -81,5 +81,5 @@
 	if (rc != EOK) {
 		printf("%s: Error while creating writer port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/net/loopip/loopip.c
===================================================================
--- uspace/srv/net/loopip/loopip.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/net/loopip/loopip.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -253,5 +253,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed to initialize logging: %s.\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
@@ -259,5 +259,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed to initialize loopip: %s.\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
Index: uspace/srv/net/slip/slip.c
===================================================================
--- uspace/srv/net/slip/slip.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/net/slip/slip.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -421,5 +421,5 @@
 	if (argc != 3) {
 		usage();
-		return EINVAL;
+		return EXIT_RC(EINVAL);
 	}
 
@@ -427,5 +427,5 @@
 	if (rc != EOK) {
 		printf(NAME ": failed to initialize log\n");
-		return rc;
+		return EXIT_RC(rc);
 	}
 
Index: uspace/srv/ns/ns.c
===================================================================
--- uspace/srv/ns/ns.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/ns/ns.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -42,4 +42,5 @@
 #include <abi/ipc/interfaces.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <macros.h>
@@ -133,13 +134,13 @@
 	int rc = service_init();
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	
 	rc = clonable_init();
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	
 	rc = task_init();
 	if (rc != EOK)
-		return rc;
+		return EXIT_RC(rc);
 	
 	async_set_fallback_port_handler(ns_connection, NULL);
Index: uspace/srv/test/chardev-test/main.c
===================================================================
--- uspace/srv/test/chardev-test/main.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/test/chardev-test/main.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -35,4 +35,5 @@
 #include <mem.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 
@@ -114,5 +115,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed registering server.: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -132,5 +133,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -138,5 +139,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -144,5 +145,5 @@
 	if (rc != EOK) {
 		printf("%s: Failed registering service.: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
Index: uspace/srv/vfs/vfs.c
===================================================================
--- uspace/srv/vfs/vfs.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/srv/vfs/vfs.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
@@ -98,5 +98,5 @@
 		printf("%s: Failed to initialize VFS node hash table\n",
 		    NAME);
-		return ENOMEM;
+		return EXIT_RC(ENOMEM);
 	}
 	
@@ -108,5 +108,5 @@
 	if (plb == AS_MAP_FAILED) {
 		printf("%s: Cannot create address space area\n", NAME);
-		return ENOMEM;
+		return EXIT_RC(ENOMEM);
 	}
 	memset(plb, 0, PLB_SIZE);
@@ -125,5 +125,5 @@
 	if (rc != EOK) {
 		printf("%s: Cannot create pager port: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 
@@ -145,5 +145,5 @@
 	if (rc != EOK) {
 		printf("%s: Cannot register VFS service: %s\n", NAME, str_error(rc));
-		return rc;
+		return EXIT_RC(rc);
 	}
 	
