From owner-freebsd-stable@FreeBSD.ORG Thu Feb 3 18:12:39 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E60FE106564A for ; Thu, 3 Feb 2011 18:12:39 +0000 (UTC) (envelope-from eivinde@terraplane.org) Received: from mail48.e.nsc.no (mail48.e.nsc.no [193.213.115.48]) by mx1.freebsd.org (Postfix) with ESMTP id 4973D8FC0A for ; Thu, 3 Feb 2011 18:12:38 +0000 (UTC) Received: from rumrunner.mine.nu (ti0027a380-0970.bb.online.no [80.212.66.204]) by mail48.nsc.no (8.14.3/8.14.3) with ESMTP id p13HvAhg001788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 3 Feb 2011 18:57:11 +0100 (MET) Received: from rumrunner.mine.nu (localhost [127.0.0.1]) by rumrunner.mine.nu (8.14.4/8.14.2) with ESMTP id p13Hv9Zi082197 for ; Thu, 3 Feb 2011 18:57:10 +0100 (CET) (envelope-from eivinde@terraplane.org) Received: from localhost (rumrunner@localhost) by rumrunner.mine.nu (8.14.4/8.13.8/Submit) with ESMTP id p13Hv9Lt082194 for ; Thu, 3 Feb 2011 18:57:09 +0100 (CET) (envelope-from eivinde@terraplane.org) X-Authentication-Warning: rumrunner.mine.nu: rumrunner owned process doing -bs Date: Thu, 3 Feb 2011 18:57:09 +0100 (CET) From: Eivind E X-X-Sender: rumrunner@rumrunner.mine.nu To: freebsd-stable@freebsd.org Message-ID: <20110203185238.W82140@rumrunner.mine.nu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: who vs who am i output X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: eivinde@terraplane.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2011 18:12:40 -0000 On freebsd 7.x and previous the output from "who am i" was formatted just like who : [rumrunner] ---> who;who am i rumrunner ttyp0 3 feb 18:45 (elg) rumrunner ttyp0 3 feb 18:45 (elg) On 8.x there's a difference : [rumrunner] ---> who;who am i rumrunner pts/1 3 feb 17:53 (:0.0) rumrunner 1 3 feb 18:45 Is this intended or would something like the patch below be correct? Index: usr.bin/who/who.c =================================================================== --- usr.bin/who/who.c 2011-01-20 14:25:17.000000000 +0100 +++ usr.bin/who/who.c 2011-01-20 14:35:25.000000000 +0100 @@ -266,8 +266,8 @@ if ((tty = ttyname(STDIN_FILENO)) == NULL) tty = "tty??"; - else if ((p = strrchr(tty, '/')) != NULL) - tty = p + 1; + else + tty = strchr(tty+1,'/')+1; /* Search utmp for our tty, dump first matching record. */ while (fread(&ut, sizeof(ut), 1, fp) == 1) -- _ _ // \\// Eivind Evensen \/