From owner-freebsd-current@FreeBSD.ORG Wed Oct 17 18:41:08 2007 Return-Path: Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B49FE16A468 for ; Wed, 17 Oct 2007 18:41:08 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2F27313C4AC for ; Wed, 17 Oct 2007 18:41:07 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l9HIf68r076838; Wed, 17 Oct 2007 22:41:06 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1192646466; bh=meOptCNoDeBgczpzfvsgO8MJURbhkzVt6glfQlS CEq0=; l=521; h=Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:User-Agent; b=qOd0h/eD16xxSRTtkYyEtJql1+QFRZVcBsav+uk5 CJOM3zeLE4KLQv/UZ1OxRaLRKf6+dfaRr/iNMnQZIXz83Y1oPlynkOR9U0HaLkY1HTP 6PAl7JEne+NdB8scg7bus4x/7MlcvXeTKbnA9JJa+T2wPn58dGU8roTdlkBNITLM= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l9HIf6bs076837; Wed, 17 Oct 2007 22:41:06 +0400 (MSD) (envelope-from ache) Date: Wed, 17 Oct 2007 22:41:05 +0400 From: Andrey Chernov To: Artem Kuchin Message-ID: <20071017184105.GA76805@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Artem Kuchin , freebsd-current@FreeBSD.ORG References: <00bd01c810ec$10371230$0c00a8c0@Artem> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00bd01c810ec$10371230$0c00a8c0@Artem> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current@FreeBSD.ORG Subject: Re: Broken su in current - trying to fix myself, help needed! 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: Wed, 17 Oct 2007 18:41:08 -0000 On Wed, Oct 17, 2007 at 10:32:16PM +0400, Artem Kuchin wrote: > There are such like in the default: dection of switch > > child_pgrp = getpgid(child_pid); > if (tcgetpgrp(STDERR_FILENO) == child_pgrp) > tcsetpgrp(STDERR_FILENO, getpgrp()); > > > The problem is here. > getpgid(child_pid) simply fails with errno 3 (process doesn't exist) The question is: why getpgid() fails while process really exists (in stopped state)? -- http://ache.pp.ru/