Index: uspace/lib/posix/unistd.c
===================================================================
--- uspace/lib/posix/unistd.c	(revision 91aded72e276cb76865b85e9074e557a537f4c96)
+++ uspace/lib/posix/unistd.c	(revision 94f8b81cc0d9e323b41f8e3b2c969703036cb588)
@@ -90,5 +90,5 @@
 	/* Always returns false, because there is no easy way to find
      * out under HelenOS. */
-	return false;
+	return 0;
 }
 
@@ -207,9 +207,5 @@
 		/* Check file existence by attempt to open it. */
 		int fd = open(path, O_RDONLY);
-		if (fd < 0) {
-			/* FIXME: open() returns error code as negative retval. */
-			errno = -fd;
-			fd = -1;
-		} else {
+		if (fd != -1) {
 			close(fd);
 		}
@@ -239,6 +235,8 @@
 		clk_tck = ((long) cpu_stats[0].frequency_mhz) * 1000000L;
 	}
-	free(cpu_stats);
-	cpu_stats = 0;
+	if (cpu_stats) {
+		free(cpu_stats);
+		cpu_stats = 0;
+	}
 
 	long phys_pages = 0;
@@ -248,7 +246,7 @@
 		phys_pages = (long) (mem_stats->total / getpagesize());
 		avphys_pages = (long) (mem_stats->free / getpagesize());
-	}
-	free(mem_stats);
-	mem_stats = 0;
+		free(mem_stats);
+		mem_stats = 0;
+	}
 
 	switch (name) {
