Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/lib loadfile sets errno, return the corr...



details:   https://anonhg.NetBSD.org/src/rev/ea4044c6a8e3
branches:  trunk
changeset: 847008:ea4044c6a8e3
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 07 02:29:03 2019 +0000

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

diffstat:

 sys/arch/i386/stand/lib/exec.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 7ba0103f05de -r ea4044c6a8e3 sys/arch/i386/stand/lib/exec.c
--- a/sys/arch/i386/stand/lib/exec.c    Sat Dec 07 01:00:40 2019 +0000
+++ b/sys/arch/i386/stand/lib/exec.c    Sat Dec 07 02:29:03 2019 +0000
@@ -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 @@
        /* 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 @@
        /* 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 @@
                 */
                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 @@
        marks[MARK_START] = loadaddr;
        if ((fd = loadfile(file, marks,
            LOAD_KERNEL & ~(floppy ? LOAD_BACKWARDS : 0))) == -1)
-               return EIO;
+               return errno;
 
        close(fd);
 



Home | Main Index | Thread Index | Old Index