From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 1 18:10:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DF6F81C3 for ; Thu, 1 Aug 2013 18:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE02A2235 for ; Thu, 1 Aug 2013 18:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r71IA1aN044201 for ; Thu, 1 Aug 2013 18:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r71IA1Mo044200; Thu, 1 Aug 2013 18:10:01 GMT (envelope-from gnats) Date: Thu, 1 Aug 2013 18:10:01 GMT Message-Id: <201308011810.r71IA1Mo044200@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: bin/172542: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 18:10:02 -0000 The following reply was made to PR bin/172542; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/172542: commit references a PR Date: Thu, 1 Aug 2013 18:07:06 +0000 (UTC) Author: marcel Date: Thu Aug 1 18:06:58 2013 New Revision: 253862 URL: http://svnweb.freebsd.org/changeset/base/253862 Log: Fix the build of the testmain target. This target compiles a Forth interpreter that can be run on the system and as such cannot be compiled against libbstand. On the one hand this means we need to include the usual headers for system interfaces that we use and on the the other hand we can only use standard system interfaces. While here, define local variables only when needed to make this WARNS=2 clean on amd64. PR: 172542 Obtained from: peterj@ Pointed out by: Jan Beich Modified: head/sys/boot/ficl/loader.c Modified: head/sys/boot/ficl/loader.c ============================================================================== --- head/sys/boot/ficl/loader.c Thu Aug 1 16:04:48 2013 (r253861) +++ head/sys/boot/ficl/loader.c Thu Aug 1 18:06:58 2013 (r253862) @@ -33,7 +33,13 @@ *******************************************************************/ #ifdef TESTMAIN +#include +#include +#include +#include +#include #include +#include #else #include #endif @@ -135,9 +141,9 @@ void ficlGetenv(FICL_VM *pVM) { #ifndef TESTMAIN - char *name; + char *name, *value; #endif - char *namep, *value; + char *namep; int names; #if FICL_ROBUST > 1 @@ -243,9 +249,9 @@ void ficlFindfile(FICL_VM *pVM) { #ifndef TESTMAIN - char *name; + char *name, *type; #endif - char *type, *namep, *typep; + char *namep, *typep; struct preloaded_file* fp; int names, types; @@ -511,6 +517,14 @@ static void pfread(FICL_VM *pVM) */ static void pfreaddir(FICL_VM *pVM) { +#ifdef TESTMAIN + static union { + struct dirent dirent; + char buf[512]; + } u; + off_t off; + int len; +#endif struct dirent *d; int fd; @@ -519,7 +533,20 @@ static void pfreaddir(FICL_VM *pVM) #endif fd = stackPopINT(pVM->pStack); +#if TESTMAIN + /* + * The readdirfd() function is specific to the loader environment. + * We do the best we can to make freaddir work, but it's not at + * all guaranteed. + */ + off = lseek(fd, 0LL, SEEK_CUR); + len = getdents(fd, u.buf, sizeof(u.buf)); + d = (len != -1) ? &u.dirent : NULL; + if (d != NULL) + lseek(fd, off + d->d_reclen, SEEK_SET); +#else d = readdirfd(fd); +#endif if (d != NULL) { stackPushPtr(pVM->pStack, d->d_name); stackPushINT(pVM->pStack, strlen(d->d_name)); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"