From owner-freebsd-gnome Wed Aug 7 2:20:16 2002 Delivered-To: freebsd-gnome@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2336A37B400 for ; Wed, 7 Aug 2002 02:20:11 -0700 (PDT) Received: from alcatraz.iptelecom.net.ua (alcatraz.iptelecom.net.ua [212.9.224.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E1EE43E70 for ; Wed, 7 Aug 2002 02:20:07 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Received: from relay.iptelecom.net.ua (alcatraz.iptelecom.net.ua [212.9.224.15]) by alcatraz.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id MAA90485; Wed, 7 Aug 2002 12:20:02 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: from vircheck.ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by relay.iptelecom.net.ua (8.12.4/8.12.4) with ESMTP id g779Ju19090303; Wed, 7 Aug 2002 12:19:58 +0300 (EEST) Received: from vega.vega.com (h3.234.dialup.iptcom.net [212.9.234.3]) by vircheck.ipcard.iptcom.net (8.12.3/8.12.3) with ESMTP id g779JnoQ007278; Wed, 7 Aug 2002 12:19:51 +0300 (EEST) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.12.5/8.11.3) with ESMTP id g779Jmxg024402; Wed, 7 Aug 2002 12:19:48 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3D50E65E.BC416D0@FreeBSD.org> Date: Wed, 07 Aug 2002 12:20:30 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Joe Marcus Clarke Cc: George , gnome@FreeBSD.ORG Subject: Re: GDM 2.4.0.x & FreeBSD References: <20020715225248.GI19585@monique.linux.bogus> <20020729222247.E308-100000@shumai.marcuscom.com> <20020731170330.GB20594@monique.linux.bogus> <1028675476.690.61.camel@gyros.marcuscom.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-gnome@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joe Marcus Clarke wrote: > > On Wed, 2002-07-31 at 13:03, George wrote: > > On Mon, Jul 29, 2002 at 10:25:09PM -0400, Joe Marcus Clarke wrote: > > > George, I just pulled down your latest diffs from CVS, but the problem > > > with gdm from /etc/ttys. I'm still getting the EBADF from slave.c at > > > lines 1495 and 1500. > > > > I suppose these are the dup2 lines. Hmmm, this is very weird, I can't see > > why it wouldn't be possible to dup into stdin and stdout. Perhaps the > > solution may be to not use stdin and stdout in this case (it's not neccessary > > really, it's just the original design of the beast). > > > > can you try to change this to: > > > > if (pipe1[1] != STDOUT_FILENO) { > > close (STDOUT_FILENO); > > dup2 (pipe1[1], STDOUT_FILENO); > > close (pipe1[1]); > > } > > > > if (pipe2[0] != STDIN_FILENO) { > > close (STDIN_FILENO); > > dup2 (pipe2[0], STDIN_FILENO); > > close (pipe2[0]); > > } > > > > (Note those if's are just an anality and something I'll get rid of later, > > they will always trigger) > > > > Perhaps we can't dup into those original fd's, though dup2 should do the > > close for us. > > I tried your new file descriptor patch to slave.c, and this made things > worse. Now, gdm doesn't even start. It continues to start, die, and > restart, until it does so enough times, then the display is disabled. > > To fix this, I took out the two lines that closed the child end of the > pipes (lines 1507 and 1508). On FreeBSD, if one end of a pipe is > closed, the pipe is considered widowed, and the process gets hit with a > SIGPIPE. From FreeBSD's pipe(2) manpage: This is incorrect interpretation. Actually, for historical reasons pipe(2) call returns two bi-directional pipes, so that it is absolutely valid to close unused one both in the clien and server (check src/lib/libc/gen/popen.c for example). -Maxim > > "A pipe that has had an end closed is considered widowed. Writing on > such a pipe causes the writing process to receive a SIGPIPE signal. > Widowing a pipe is the only way to deliver end-of-file to a reader: > after the reader consumes any buffered data, reading a widowed pipe > returns a zero count. > > The bidirectional nature of this implementation of pipes is not portable > to older systems, so it is recommended to use the convention for using > the endpoints in the traditional manner when using a pipe in one direc- > tion." > > However, even after removing the close calls, the problem with the > unusable Username field remains. The file descriptor numbers for the > pipe ends remain constant at 9 for out and 10 for in. This is true even > if gdm is started manually without the --nodaemon option. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-gnome" in the body of the message