Index: libc/generic/as.c
===================================================================
--- libc/generic/as.c	(revision 20a9b85953864efe36abda6ed2c4e3c4ab28c4f5)
+++ libc/generic/as.c	(revision 46ec2c062682c94d055ab4237942e46f653200a8)
@@ -52,9 +52,20 @@
  * @param flags Currently unused.
  *
- * @return address on success, (void *) -1 otherwise.
+ * @return Zero on success or a code from @ref errno.h on failure.
  */
-void *as_area_resize(void *address, size_t size, int flags)
+int as_area_resize(void *address, size_t size, int flags)
 {
-	return (void *) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
+	return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
+}
+
+/** Destroy address space area.
+ *
+ * @param address Virtual address pointing into the address space area being destroyed.
+ *
+ * @return Zero on success or a code from @ref errno.h on failure.
+ */
+int as_area_destroy(void *address)
+{
+	return __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t ) address);
 }
 
@@ -111,4 +122,5 @@
 void *sbrk(ssize_t incr)
 {
+	int rc;
 	void *res;
 	/* Check for invalid values */
@@ -122,6 +134,6 @@
 		return NULL;
 
-	res = as_area_resize(&_heap, heapsize + incr,0);
-	if (!res)
+	rc = as_area_resize(&_heap, heapsize + incr,0);
+	if (rc != 0)
 		return NULL;
 	
Index: libc/include/as.h
===================================================================
--- libc/include/as.h	(revision 20a9b85953864efe36abda6ed2c4e3c4ab28c4f5)
+++ libc/include/as.h	(revision 46ec2c062682c94d055ab4237942e46f653200a8)
@@ -34,5 +34,6 @@
 
 extern void *as_area_create(void *address, size_t size, int flags);
-extern void *as_area_resize(void *address, size_t size, int flags);
+extern int as_area_resize(void *address, size_t size, int flags);
+extern int as_area_destroy(void *address);
 extern int as_area_accept(task_id_t id, void *base, size_t size, int flags);
 extern int as_area_send(task_id_t id, void *base);
Index: pci/libpci/access.c
===================================================================
--- pci/libpci/access.c	(revision 20a9b85953864efe36abda6ed2c4e3c4ab28c4f5)
+++ pci/libpci/access.c	(revision 46ec2c062682c94d055ab4237942e46f653200a8)
@@ -26,4 +26,7 @@
 	int i;
 
+	if (!a)
+		return NULL;
+		
 	bzero(a, sizeof(*a));
 	for (i = 0; i < PCI_ACCESS_MAX; i++)
@@ -38,6 +41,5 @@
 
 	if (!x)
-		a->error("Out of memory (allocation of %d bytes failed)",
-			 size);
+		a->error("Out of memory (allocation of %d bytes failed)", size);
 	return x;
 }
@@ -219,6 +221,5 @@
 {
 	if (pos & (len - 1))
-		d->access->error("Unaligned write: pos=%02x,len=%d", pos,
-				 len);
+		d->access->error("Unaligned write: pos=%02x,len=%d", pos, len);
 	if (pos + len <= d->cache_len)
 		memcpy(d->cache + pos, buf, len);
@@ -246,7 +247,5 @@
 {
 	if (pos < d->cache_len) {
-		int l =
-		    (pos + len >=
-		     d->cache_len) ? (d->cache_len - pos) : len;
+		int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len;
 		memcpy(d->cache + pos, buf, l);
 	}
@@ -261,6 +260,5 @@
 	}
 	if (flags & ~d->known_fields)
-		d->known_fields |=
-		    d->methods->fill_info(d, flags & ~d->known_fields);
+		d->known_fields |= d->methods->fill_info(d, flags & ~d->known_fields);
 	return d->known_fields;
 }
Index: pci/libpci/i386-ports.c
===================================================================
--- pci/libpci/i386-ports.c	(revision 20a9b85953864efe36abda6ed2c4e3c4ab28c4f5)
+++ pci/libpci/i386-ports.c	(revision 46ec2c062682c94d055ab4237942e46f653200a8)
@@ -80,6 +80,5 @@
 	for (d.dev = 0; d.dev < 32; d.dev++) {
 		u16 class, vendor;
-		if (m->
-		    read(&d, PCI_CLASS_DEVICE, (byte *) & class,
+		if (m->read(&d, PCI_CLASS_DEVICE, (byte *) & class,
 			 sizeof(class))
 		    && (class == cpu_to_le16(PCI_CLASS_BRIDGE_HOST)
@@ -179,5 +178,4 @@
 {
 	/* This is ugly and tends to produce false positives. Beware. */
-
 	outb(0x00, 0xCFB);
 	outb(0x00, 0xCF8);
@@ -227,6 +225,5 @@
 
 	if (d->dev >= 16)
-		d->access->
-		    error("conf2_write: only first 16 devices exist.");
+		d->access->error("conf2_write: only first 16 devices exist.");
 	outb((d->func << 1) | 0xf0, 0xcf8);
 	outb(d->bus, 0xcfa);
