From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 13 14:37:59 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4138016A407 for ; Wed, 13 Sep 2006 14:37:59 +0000 (UTC) (envelope-from saper@SYSTEM.PL) Received: from mail01.ish.de (pip251.ish.de [80.69.98.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id A2EBE43D45 for ; Wed, 13 Sep 2006 14:37:58 +0000 (GMT) (envelope-from saper@SYSTEM.PL) Received: from [80.69.97.9] (HELO saperski.saper.info) by mail-fe-01.mail01.ish.de (CommuniGate Pro SMTP 5.0.6) with ESMTPS id 75710774 for emulation@freebsd.org; Wed, 13 Sep 2006 16:37:56 +0200 Received: from [127.0.0.1] (saperski.saper.info [127.0.0.1]) by saperski.saper.info (8.13.8/8.13.8) with ESMTP id k8DEbpGL002342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 13 Sep 2006 16:37:54 +0200 (CEST) (envelope-from saper@SYSTEM.PL) Message-ID: <450817BF.8010402@SYSTEM.PL> Date: Wed, 13 Sep 2006 16:37:51 +0200 From: Marcin Cieslak User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.6) Gecko/20060912 SeaMonkey/1.0.4 MIME-Version: 1.0 To: emulation@freebsd.org References: <4506ABF1.6010407@SYSTEM.PL> <20060913143521.9jf3a85qkocww4c4@webmail.leidinger.net> In-Reply-To: <20060913143521.9jf3a85qkocww4c4@webmail.leidinger.net> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: LTP: reboot02 patch X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 14:37:59 -0000 Thanks! Can you also fix a link to your patch? I think one directory is missing.... Attached please also find a patch for linux_reboot(), fixes reboot02. -- << Marcin Cieslak // saper@system.pl >> --- linux_misc.c Wed Sep 13 16:16:56 2006 +++ linux_misc.c_new Wed Sep 13 16:14:10 2006 @@ -1321,6 +1321,9 @@ #define REBOOT_CAD_ON 0x89abcdef #define REBOOT_CAD_OFF 0 #define REBOOT_HALT 0xcdef0123 +#define REBOOT_RESTART 0x01234567 +#define REBOOT_RESTART2 0xA1B2C3D4 +#define REBOOT_POWEROFF 0x4321FEDC int linux_reboot(struct thread *td, struct linux_reboot_args *args) @@ -1331,10 +1334,24 @@ if (ldebug(reboot)) printf(ARGS(reboot, "0x%x"), args->cmd); #endif - if (args->cmd == REBOOT_CAD_ON || args->cmd == REBOOT_CAD_OFF) - return (0); - bsd_args.opt = (args->cmd == REBOOT_HALT) ? RB_HALT : 0; - return (reboot(td, &bsd_args)); + switch(args->cmd) { + case REBOOT_CAD_ON: + case REBOOT_CAD_OFF: + return suser(td); + case REBOOT_HALT: + bsd_args.opt = RB_HALT; + break; + case REBOOT_RESTART: + case REBOOT_RESTART2: + bsd_args.opt = 0; + break; + case REBOOT_POWEROFF: + bsd_args.opt = RB_POWEROFF; + break; + default: + return EINVAL; + } + return reboot(td, &bsd_args); } #ifndef __alpha__