From owner-freebsd-current@FreeBSD.ORG Mon Jul 16 09:21:51 2007 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B541B16A404; Mon, 16 Jul 2007 09:21:51 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9D913C4B3; Mon, 16 Jul 2007 09:21:50 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from kobe.laptop (vader.bytemobile.ondsl.gr [83.235.244.135]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l6G9LSxS015719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 16 Jul 2007 12:21:34 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l6G9LBgu002649; Mon, 16 Jul 2007 12:21:27 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l6G9LAu0002648; Mon, 16 Jul 2007 12:21:10 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Date: Mon, 16 Jul 2007 12:21:10 +0300 From: Giorgos Keramidas To: Christos Zoulas Message-ID: <20070716092109.GB2568@kobe.laptop> References: <20070714005559.GB6661@kobe.laptop> <20070716030052.1B43D56407@rebar.astron.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070716030052.1B43D56407@rebar.astron.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.923, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.48, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: Mark Peek , tcsh-bugs@mx.gw.com, kris@FreeBSD.org, current@FreeBSD.org Subject: Re: tcsh backtick hang info X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2007 09:21:51 -0000 On 2007-07-15 23:00, Christos Zoulas wrote: > On Jul 14, 3:55am, keramida@freebsd.org (Giorgos Keramidas) wrote: > | Hi Christos, > | > | Can we persuade you to include the following local patch I keep for > | autologout detection with /dev/pts/XXX ptys in FreeBSD? > | > | %%% > | Fix pty detection logic of tcsh autologout initialization. > | > | Noticed by: kris > | > | diff --git a/contrib/tcsh/sh.c b/contrib/tcsh/sh.c > | --- a/contrib/tcsh/sh.c > | +++ b/contrib/tcsh/sh.c > | @@ -457,7 +457,7 @@ main(int argc, char **argv) > | if (*cp) { > | /* only for login shells or root and we must have a tty */ > | if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) { > | - cp = cp2 + 1; > | + cp2 = cp2 + 1; > | } > | else > | cp2 = cp; > | %%% > > The code is wrong but I think that the fix is not exactly right... The > following should work: > > /* only for login shells or root and we must have a tty */ > if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) { > cp2 = cp2 + 1; > } > else > cp2 = cp; > if (!(((Strncmp(cp2, STRtty, 3) == 0) && Isalpha(cp2[3])) || > Strstr(cp, Strslptssl) != NULL)) { > if (getenv("DISPLAY") == NULL) { > /* NOT on X window shells */ > setcopy(STRautologout, STRdefautologout, VAR_READWRITE); Ah! Much better indeed. I'm happy a fix is going to be in upstream tcsh now :-) > Thanks for the bug report. wonder how come nobody complained for > years! This was really brought to my notice by Kris Kennaway, so he's the one we should thank.