Index: kernel/generic/src/proc/program.c
===================================================================
--- kernel/generic/src/proc/program.c	(revision 692be1ae416d773be35a842131ca027484d54344)
+++ kernel/generic/src/proc/program.c	(revision b39b5cb669ab0cebd3e1df1e46c056940a004088)
@@ -80,4 +80,5 @@
 	kernel_uarg->uspace_uarg = NULL;
 	
+	prg->loader_status = EE_OK;
 	prg->task = task_create(as, name);
 	if (!prg->task)
@@ -111,9 +112,10 @@
  * executable image. The task is returned in *task.
  *
- * @param image_addr Address of an executable program image.
- * @param name       Name to set for the program's task.
- * @param prg        Buffer for storing program info. If image_addr
- *                   points to a loader image, p->task will be set to
- *                   NULL and EOK will be returned.
+ * @param[in]  image_addr Address of an executable program image.
+ * @param[in]  name       Name to set for the program's task.
+ * @param[out] prg        Buffer for storing program info.
+ *                        If image_addr points to a loader image,
+ *                        prg->task will be set to NULL and EOK
+ *                        will be returned.
  *
  * @return EOK on success or negative error code.
@@ -126,12 +128,11 @@
 		return ENOMEM;
 	
-	unsigned int rc = elf_load((elf_header_t *) image_addr, as, 0);
-	LOG("elf_load() -> %u\n", rc);
-	if (rc != EE_OK) {
+	prg->loader_status = elf_load((elf_header_t *) image_addr, as, 0);
+	if (prg->loader_status != EE_OK) {
 		as_destroy(as);
 		prg->task = NULL;
 		prg->main_thread = NULL;
 		
-		if (rc != EE_LOADER)
+		if (prg->loader_status != EE_LOADER)
 			return ENOTSUP;
 		
@@ -141,6 +142,5 @@
 		
 		program_loader = image_addr;
-		LOG("Registered program loader at %p",
-		    (void *) image_addr);
+		printf("Program loader at %p\n", (void *) image_addr);
 		
 		return EOK;
@@ -172,9 +172,10 @@
 	}
 	
-	unsigned int rc = elf_load((elf_header_t *) program_loader, as,
+	prg->loader_status = elf_load((elf_header_t *) program_loader, as,
 	    ELD_F_LOADER);
-	if (rc != EE_OK) {
+	if (prg->loader_status != EE_OK) {
 		as_destroy(as);
-		printf("Cannot spawn loader (%s)\n", elf_error(rc));
+		printf("Cannot spawn loader (%s)\n",
+		    elf_error(prg->loader_status));
 		return ENOENT;
 	}
