From owner-freebsd-bugs@FreeBSD.ORG Fri Jun 25 11:00:44 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B26D16A4D0 for ; Fri, 25 Jun 2004 11:00:44 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E52A243D64 for ; Fri, 25 Jun 2004 11:00:43 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i5PB0Ztr043950 for ; Fri, 25 Jun 2004 11:00:35 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i5PB0ZAN043949; Fri, 25 Jun 2004 11:00:35 GMT (envelope-from gnats) Resent-Date: Fri, 25 Jun 2004 11:00:35 GMT Resent-Message-Id: <200406251100.i5PB0ZAN043949@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rene de Vries Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 688C816A4CE for ; Fri, 25 Jun 2004 10:54:10 +0000 (GMT) Received: from bastix.tunix.nl (bastix.tunix.nl [193.79.201.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id C371043D54 for ; Fri, 25 Jun 2004 10:54:08 +0000 (GMT) (envelope-from rene@tunix.nl) Received: (from root@localhost) by bastix.tunix.nl (8.9.3c/8.6.12) id MAA00658 for ; Fri, 25 Jun 2004 12:53:47 +0200 (CEST) Received: by bastix.tunix.nl (TUNIX txp2/smap) for id sma000396; Fri, 25 Jun 04 12:53:06 +0200 Received: from upsilix.tunix.nl (upsilix.tunix.nl [172.16.2.22]) by fix.tunix.nl (8.10.2+Sun/8.10.2) with ESMTP id i5PAr6o29809 for ; Fri, 25 Jun 2004 12:53:06 +0200 (MEST) Received: from upsilix.tunix.nl (localhost.tunix.nl [127.0.0.1]) by upsilix.tunix.nl (8.12.8p2/8.12.6) with ESMTP id i5PAr6D2063447 for ; Fri, 25 Jun 2004 12:53:06 +0200 (CEST) (envelope-from rene@upsilix.tunix.nl) Received: (from rene@localhost) by upsilix.tunix.nl (8.12.8p2/8.12.6/Submit) id i5PAr6QX063446; Fri, 25 Jun 2004 12:53:06 +0200 (CEST) (envelope-from rene) Message-Id: <200406251053.i5PAr6QX063446@upsilix.tunix.nl> Date: Fri, 25 Jun 2004 12:53:06 +0200 (CEST) From: Rene de Vries To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/68317: on soft (clean) reboots clean dmesg output X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Rene de Vries List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2004 11:00:44 -0000 >Number: 68317 >Category: kern >Synopsis: on soft (clean) reboots clean dmesg output >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jun 25 11:00:35 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Rene de Vries >Release: FreeBSD 4.8 i386 >Organization: Tunix Internet Security & Training >Environment: System: FreeBSD upsilix.tunix.nl 4.8 FreeBSD 4.8-RELEASE-p16 #7: Wed Mar 3 15:00:31 CET 2004 rene@upsilix.tunix.nl:/usr/obj/usr/src/sys/UPSILIX i386 >Description: On clean reboots wipe the dmesg output. For all other reboots try to keep as much as possible (no change there). Index: sys/kern/kern_shutdown.c =================================================================== RCS file: sys/kern/kern_shutdown.c,v retrieving revision 1.1.1.4 retrieving revision 1.2 diff -u -r1.1.1.4 -r1.2 --- sys/kern/kern_shutdown.c 2002/08/28 08:58:58 1.1.1.4 +++ sys/kern/kern_shutdown.c 2004/03/02 13:51:36 1.2 @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -332,6 +333,10 @@ printf("\n"); printf("The operating system has halted.\n"); printf("Please press any key to reboot.\n\n"); + if (msgbufp != (struct msgbuf *) 0) { + /* fix dmesg buffer on soft reboot */ + msgbufp->msg_magic = 0; + } switch (cngetc()) { case -1: /* No console, just die */ cpu_halt(); @@ -385,6 +390,10 @@ { printf("Rebooting...\n"); DELAY(1000000); /* wait 1 sec for printf's to complete and be read */ + if (msgbufp != (struct msgbuf *) 0) { + /* fix dmesg buffer on soft reboot */ + msgbufp->msg_magic = 0; + } /* cpu_boot(howto); */ /* doesn't do anything at the moment */ cpu_reset(); /* NOTREACHED */ /* assuming reset worked */ >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: