From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9969 invoked by alias); 25 Oct 2008 17:46:39 -0000 Received: (qmail 9961 invoked by uid 22791); 25 Oct 2008 17:46:38 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout2.012.net.il (HELO mtaout2.012.net.il) (84.95.2.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Oct 2008 17:45:59 +0000 Received: from HOME-C4E4A596F7 ([77.126.171.110]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K9B00LFP2QW1642@i_mtaout2.012.net.il> for gdb-patches@sourceware.org; Sat, 25 Oct 2008 19:47:28 +0200 (IST) Date: Sat, 25 Oct 2008 17:46:00 -0000 From: Eli Zaretskii Subject: Re: [RFA/RFC] new setting against auto-answer? (because "input not from terminal") In-reply-to: <20081025154528.GE29998@adacore.com> X-012-Sender: halo1@inter.net.il To: Joel Brobecker Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <20081025010445.GC29038@adacore.com> <20081025154528.GE29998@adacore.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00646.txt.bz2 > Date: Sat, 25 Oct 2008 08:45:29 -0700 > From: Joel Brobecker > Cc: gdb-patches@sourceware.org > > > Is the problem with isatty returning the wrong value? If so, did you > > (or can you) try the following trick? > > > > #define ISATTY(fd) (isatty(fd) && lseek(fd,SEEK_CUR,0) == -1) > > > > and then use ISATTY instead of isatty? > > That wouldn't work, unfortunately, because the problem is that isatty > returns zero. What does lseek return with the above arguments?