From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:06:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE812A6516F; Thu, 7 Jan 2016 02:06:15 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AED531F09; Thu, 7 Jan 2016 02:06:15 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0726Exb092518; Thu, 7 Jan 2016 02:06:14 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0726EqC092517; Thu, 7 Jan 2016 02:06:14 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601070206.u0726EqC092517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 02:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293296 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:06:16 -0000 Author: dteske Date: Thu Jan 7 02:06:14 2016 New Revision: 293296 URL: https://svnweb.freebsd.org/changeset/base/293296 Log: MFC SVN revisions 292899,292996,292999-293000. r292899: Fix stack leak introduced by SVN r97201 r292996: Remove debugging messages added by SVN r187143 r292999: Fix a memory leak r293000: Remove supposition comment Modified: stable/10/sys/boot/forth/support.4th Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/support.4th ============================================================================== --- stable/10/sys/boot/forth/support.4th Thu Jan 7 02:04:17 2016 (r293295) +++ stable/10/sys/boot/forth/support.4th Thu Jan 7 02:06:14 2016 (r293296) @@ -684,7 +684,7 @@ only forth also support-functions also f s" loader_conf_files" getenv conf_files string= ; -: set_nextboot_conf \ XXX maybe do as set_conf_files ? +: set_nextboot_conf value_buffer strget unquote nextboot_conf_file string= ; @@ -833,7 +833,7 @@ get-current ( -- wid ) previous definiti repeat ; -: peek_file +: peek_file ( addr len -- ) 0 to end_of_file? reset_line_reading O_RDONLY fopen fd ! @@ -844,6 +844,7 @@ get-current ( -- wid ) previous definiti ['] process_assignment catch ['] free_buffers catch fd @ fclose + swap throw throw ; only forth also support-functions definitions @@ -851,7 +852,6 @@ only forth also support-functions defini \ Interface to loading conf files : load_conf ( addr len -- ) - \ ." ----- Trying conf " 2dup type cr \ debugging 0 to end_of_file? reset_line_reading O_RDONLY fopen fd ! @@ -943,7 +943,6 @@ string current_file_name_ref \ used to p \ loader_conf_files processing support functions : get_conf_files ( -- addr len ) \ put addr/len on stack, reset var - \ ." -- starting on <" conf_files strtype ." >" cr \ debugging conf_files strget 0 0 conf_files strset ; @@ -970,7 +969,6 @@ string current_file_name_ref \ used to p pos char+ to pos repeat addr len pos addr r@ + pos r> - - \ 2dup ." get_file_name has " type cr \ debugging ; : get_next_file ( addr len ptr -- addr len ptr' addr' len' | 0 ) @@ -1021,25 +1019,26 @@ string current_file_name_ref \ used to p ; : get_nextboot_conf_file ( -- addr len ) - nextboot_conf_file strget strdup \ XXX is the strdup a leak ? + nextboot_conf_file strget ; : rewrite_nextboot_file ( -- ) get_nextboot_conf_file O_WRONLY fopen fd ! fd @ -1 = if EOPEN throw then - fd @ s' nextboot_enable="NO" ' fwrite + fd @ s' nextboot_enable="NO" ' fwrite ( fd buf len -- nwritten ) drop fd @ fclose ; -: include_nextboot_file +: include_nextboot_file ( -- ) get_nextboot_conf_file - ['] peek_file catch + ['] peek_file catch if 2drop then nextboot? if get_nextboot_conf_file + current_file_name_ref strref ['] load_conf catch process_conf_errors - ['] rewrite_nextboot_file catch + ['] rewrite_nextboot_file catch if 2drop then then ;