From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 10:10:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04D185EF; Wed, 1 Apr 2015 10:10:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3B802DA; Wed, 1 Apr 2015 10:10:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t31AALdh087431; Wed, 1 Apr 2015 10:10:21 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t31AAL1W087430; Wed, 1 Apr 2015 10:10:21 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201504011010.t31AAL1W087430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Wed, 1 Apr 2015 10:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280954 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 10:10:22 -0000 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); } /*