From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 04:18:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CDB1E72; Wed, 5 Nov 2014 04:18:42 +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 48CCC915; Wed, 5 Nov 2014 04:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA54IgbB013134; Wed, 5 Nov 2014 04:18:42 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA54Igtr013133; Wed, 5 Nov 2014 04:18:42 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411050418.sA54Igtr013133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 5 Nov 2014 04:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274127 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 04:18:42 -0000 Author: marcel Date: Wed Nov 5 04:18:41 2014 New Revision: 274127 URL: https://svnweb.freebsd.org/changeset/base/274127 Log: In alloc_pread() and kern_pread(), print errors only when DEBUG is defined. An error is not fatal and is supposed to be handled by the caller. Obtained from: Juniper Networks, Inc. Modified: head/sys/boot/common/misc.c Modified: head/sys/boot/common/misc.c ============================================================================== --- head/sys/boot/common/misc.c Wed Nov 5 04:09:10 2014 (r274126) +++ head/sys/boot/common/misc.c Wed Nov 5 04:18:41 2014 (r274127) @@ -121,12 +121,16 @@ kern_pread(int fd, vm_offset_t dest, siz ssize_t nread; if (lseek(fd, off, SEEK_SET) == -1) { +#ifdef DEBUG printf("\nlseek failed\n"); +#endif return (-1); } nread = archsw.arch_readin(fd, dest, len); if (nread != len) { +#ifdef DEBUG printf("\nreadin failed\n"); +#endif return (-1); } return (0); @@ -144,17 +148,23 @@ alloc_pread(int fd, off_t off, size_t le buf = malloc(len); if (buf == NULL) { +#ifdef DEBUG printf("\nmalloc(%d) failed\n", (int)len); +#endif return (NULL); } if (lseek(fd, off, SEEK_SET) == -1) { +#ifdef DEBUG printf("\nlseek failed\n"); +#endif free(buf); return (NULL); } nread = read(fd, buf, len); if (nread != len) { +#ifdef DEBUG printf("\nread failed\n"); +#endif free(buf); return (NULL); }