Date: Wed, 1 Apr 2015 10:10:21 +0000 (UTC) From: Roger Pau Monné <royger@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280954 - head/sys/boot/i386/libi386 Message-ID: <201504011010.t31AAL1W087430@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: royger Date: Wed Apr 1 10:10:20 2015 New Revision: 280954 URL: https://svnweb.freebsd.org/changeset/base/280954 Log: multiboot: fix error codes Return EINVAL instead of EFTYPE if we have a multiboot kernel loaded but failed to load the modules. This makes it clear that the kernel/module should be handled by the multiboot handler but something went wrong. Sponsored by: Citrix Systems R&D Modified: head/sys/boot/i386/libi386/multiboot.c Modified: head/sys/boot/i386/libi386/multiboot.c ============================================================================== --- head/sys/boot/i386/libi386/multiboot.c Wed Apr 1 10:02:28 2015 (r280953) +++ head/sys/boot/i386/libi386/multiboot.c Wed Apr 1 10:10:20 2015 (r280954) @@ -243,7 +243,7 @@ multiboot_exec(struct preloaded_file *fp /* Find the entry point of the Xen kernel and save it for later */ if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { printf("Unable to find %s entry point\n", fp->f_name); - error = EFTYPE; + error = EINVAL; goto error; } ehdr = (Elf_Ehdr *)&(md->md_data); @@ -271,7 +271,7 @@ multiboot_exec(struct preloaded_file *fp fp = file_findfile(NULL, "elf kernel"); if (fp == NULL) { printf("No FreeBSD kernel provided, aborting\n"); - error = EFTYPE; + error = EINVAL; goto error; } @@ -380,7 +380,7 @@ multiboot_obj_loadfile(char *filename, u printf( "Unable to load %s as a multiboot payload kernel\n", filename); - return (EFTYPE); + return (EINVAL); } /* Load kernel metadata... */ @@ -389,7 +389,7 @@ multiboot_obj_loadfile(char *filename, u if (error) { printf("Unable to load kernel %s metadata error: %d\n", rfp->f_name, error); - return (EFTYPE); + return (EINVAL); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504011010.t31AAL1W087430>