Index: kernel/genarch/src/ddi/ddi-bitmap.c
===================================================================
--- kernel/genarch/src/ddi/ddi-bitmap.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ kernel/genarch/src/ddi/ddi-bitmap.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -142,5 +142,5 @@
 	task->arch.iomapver++;
 	
-	return 0;
+	return EOK;
 }
 
Index: kernel/genarch/src/ddi/ddi-dummy.c
===================================================================
--- kernel/genarch/src/ddi/ddi-dummy.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ kernel/genarch/src/ddi/ddi-dummy.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -50,5 +50,5 @@
 errno_t ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size)
 {
-	return 0;
+	return EOK;
 }
 
@@ -65,5 +65,5 @@
 errno_t ddi_iospace_disable_arch(task_t *task, uintptr_t ioaddr, size_t size)
 {
-	return 0;
+	return EOK;
 }
 
Index: uspace/app/corecfg/corecfg.c
===================================================================
--- uspace/app/corecfg/corecfg.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/app/corecfg/corecfg.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -36,4 +36,5 @@
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #define NAME "corecfg"
Index: uspace/app/download/main.c
===================================================================
--- uspace/app/download/main.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/app/download/main.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -243,5 +243,5 @@
 	}
 
-	return EOK;
+	return 0;
 error:
 	free(buf);
Index: uspace/app/getterm/getterm.c
===================================================================
--- uspace/app/getterm/getterm.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/app/getterm/getterm.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -37,4 +37,5 @@
 #include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 #include <str_error.h>
Index: uspace/app/kio/kio.c
===================================================================
--- uspace/app/kio/kio.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/app/kio/kio.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -253,5 +253,5 @@
 		rc = EOK;
 
-	return EOK;
+	return rc;
 }
 
Index: uspace/app/sysinfo/sysinfo.c
===================================================================
--- uspace/app/sysinfo/sysinfo.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/app/sysinfo/sysinfo.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -90,5 +90,5 @@
 	fputs("')\n", stdout);
 	
-	return EOK;
+	return 0;
 }
 
@@ -109,5 +109,5 @@
 	fputs("')\n", stdout);
 	
-	return EOK;
+	return 0;
 }
 
Index: uspace/app/wifi_supplicant/wifi_supplicant.c
===================================================================
--- uspace/app/wifi_supplicant/wifi_supplicant.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/app/wifi_supplicant/wifi_supplicant.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -324,5 +324,5 @@
 	print_syntax();
 	
-	return EOK;
+	return 0;
 }
 
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -1279,4 +1279,7 @@
 	async_wait_for(req, &rc_orig);
 
+	// XXX: Workaround for GCC diagnostics.
+	*handle = -1;
+
 	if (rc_orig != EOK)
 		return (errno_t) rc_orig;
Index: uspace/lib/c/include/stdlib.h
===================================================================
--- uspace/lib/c/include/stdlib.h	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/lib/c/include/stdlib.h	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -51,4 +51,7 @@
 extern void exit(int) __attribute__((noreturn));
 
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE -1
+
 #endif
 
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/lib/drv/generic/driver.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -1009,5 +1009,5 @@
 	
 	/* Never reached. */
-	return EOK;
+	return 0;
 }
 
Index: uspace/srv/audio/hound/main.c
===================================================================
--- uspace/srv/audio/hound/main.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/audio/hound/main.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -80,5 +80,5 @@
 		log_fatal("Failed to initialize hound structure: %s",
 		    str_error(ret));
-		return -ret;
+		return ret;
 	}
 
@@ -91,5 +91,5 @@
 	if (ret != EOK) {
 		log_fatal("Failed to register server: %s", str_error(ret));
-		return -ret;
+		return ret;
 	}
 
@@ -99,5 +99,5 @@
 		    str_error(ret));
 		hound_server_unregister(id);
-		return -ret;
+		return 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 a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/bd/file_bd/file_bd.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -47,4 +47,5 @@
 #include <stddef.h>
 #include <stdint.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <str_error.h>
Index: uspace/srv/bd/sata_bd/sata_bd.c
===================================================================
--- uspace/srv/bd/sata_bd/sata_bd.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/bd/sata_bd/sata_bd.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -258,5 +258,5 @@
 	rc = get_sata_disks();
 	if (rc != EOK) {
-		// TODO: log the error
+		printf(NAME ": Cannot find SATA disks: %s.\n", str_error(rc));
 		return rc;
 	}
Index: uspace/srv/fs/cdfs/cdfs.c
===================================================================
--- uspace/srv/fs/cdfs/cdfs.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/fs/cdfs/cdfs.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -43,4 +43,5 @@
 #include <str_error.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <libfs.h>
 #include "cdfs.h"
Index: uspace/srv/fs/exfat/exfat.c
===================================================================
--- uspace/srv/fs/exfat/exfat.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/fs/exfat/exfat.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -46,4 +46,5 @@
 #include <task.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <libfs.h>
 #include "../../vfs/vfs.h"
Index: uspace/srv/fs/ext4fs/ext4fs.c
===================================================================
--- uspace/srv/fs/ext4fs/ext4fs.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/fs/ext4fs/ext4fs.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -40,4 +40,5 @@
 #include <ns.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 #include <ipc/services.h>
Index: uspace/srv/fs/fat/fat.c
===================================================================
--- uspace/srv/fs/fat/fat.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/fs/fat/fat.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -46,4 +46,5 @@
 #include <task.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <libfs.h>
 #include "../../vfs/vfs.h"
Index: uspace/srv/fs/locfs/locfs.c
===================================================================
--- uspace/srv/fs/locfs/locfs.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/fs/locfs/locfs.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -40,4 +40,5 @@
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <ipc/services.h>
 #include <ns.h>
Index: uspace/srv/fs/tmpfs/tmpfs.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/fs/tmpfs/tmpfs.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -48,4 +48,5 @@
 #include <str_error.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 #include <libfs.h>
Index: uspace/srv/fs/udf/udf.c
===================================================================
--- uspace/srv/fs/udf/udf.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/fs/udf/udf.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -42,4 +42,5 @@
 #include <errno.h>
 #include <str_error.h>
+#include <stdlib.h>
 #include <task.h>
 #include <libfs.h>
Index: uspace/srv/hid/compositor/compositor.c
===================================================================
--- uspace/srv/hid/compositor/compositor.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/hid/compositor/compositor.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -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;
 	}
 	
Index: uspace/srv/hid/isdv4_tablet/main.c
===================================================================
--- uspace/srv/hid/isdv4_tablet/main.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/hid/isdv4_tablet/main.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -320,8 +320,7 @@
 	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 ENOMEM;
 	}
 
Index: uspace/srv/hid/rfb/main.c
===================================================================
--- uspace/srv/hid/rfb/main.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/hid/rfb/main.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -224,8 +224,7 @@
 
 	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 ENOMEM;
 	}
 
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -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 a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -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/ns/ns.c
===================================================================
--- uspace/srv/ns/ns.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/ns/ns.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -42,4 +42,5 @@
 #include <abi/ipc/interfaces.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <macros.h>
Index: uspace/srv/test/chardev-test/main.c
===================================================================
--- uspace/srv/test/chardev-test/main.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
+++ uspace/srv/test/chardev-test/main.c	(revision 36df27ebb72758daf4d2179e70f231ac0e059a83)
@@ -35,4 +35,5 @@
 #include <mem.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <task.h>
 
