Module Name:    src
Committed By:   christos
Date:           Sat Dec  7 02:29:03 UTC 2019

Modified Files:
        src/sys/arch/i386/stand/lib: exec.c

Log Message:
loadfile sets errno, return the correct error, not EIO.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/i386/stand/lib/exec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/lib/exec.c
diff -u src/sys/arch/i386/stand/lib/exec.c:1.74 src/sys/arch/i386/stand/lib/exec.c:1.75
--- src/sys/arch/i386/stand/lib/exec.c:1.74	Thu Sep 12 22:19:46 2019
+++ src/sys/arch/i386/stand/lib/exec.c	Fri Dec  6 21:29:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.74 2019/09/13 02:19:46 manu Exp $	 */
+/*	$NetBSD: exec.c,v 1.75 2019/12/07 02:29:03 christos Exp $	 */
 
 /*
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -321,7 +321,7 @@ common_load_prekern(const char *file, u_
 	/* Load the prekern (static) */
 	flags = LOAD_KERNEL & ~(LOAD_HDR|LOAD_SYM);
 	if ((fd = loadfile(prekernpath, marks, flags)) == -1)
-		return EIO;
+		return errno;
 	close(fd);
 
 	prekern_start = marks[MARK_START];
@@ -334,7 +334,7 @@ common_load_prekern(const char *file, u_
 	/* Load the kernel (dynamic) */
 	flags = (LOAD_KERNEL | LOAD_DYN) & ~(floppy ? LOAD_BACKWARDS : 0);
 	if ((fd = loadfile(file, marks, flags)) == -1)
-		return EIO;
+		return errno;
 	close(fd);
 
 	kernpa_end = marks[MARK_END] - loadaddr;
@@ -399,7 +399,7 @@ common_load_kernel(const char *file, u_l
 		 */
 		marks[MARK_START] = loadaddr;
 		if ((fd = loadfile(file, marks, COUNT_KERNEL)) == -1)
-			return EIO;
+			return errno;
 		close(fd);
 
 		kernsize = marks[MARK_END];
@@ -413,7 +413,7 @@ common_load_kernel(const char *file, u_l
 	marks[MARK_START] = loadaddr;
 	if ((fd = loadfile(file, marks,
 	    LOAD_KERNEL & ~(floppy ? LOAD_BACKWARDS : 0))) == -1)
-		return EIO;
+		return errno;
 
 	close(fd);
 

Reply via email to