From owner-freebsd-bugs Wed Oct 24 5:10: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3C34637B405 for ; Wed, 24 Oct 2001 05:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9OCA1M86644; Wed, 24 Oct 2001 05:10:01 -0700 (PDT) (envelope-from gnats) Date: Wed, 24 Oct 2001 05:10:01 -0700 (PDT) Message-Id: <200110241210.f9OCA1M86644@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ian Dowse Subject: Re: bin/30993: xxgdb cannot open source file Reply-To: Ian Dowse Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/30993; it has been noted by GNATS. From: Ian Dowse To: Jin Guojun Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/30993: xxgdb cannot open source file Date: Wed, 24 Oct 2001 13:00:59 +0100 In message <3BD616EC.40F97564@lbl.gov>, Jin Guojun writes: >789 XtSetValues(sourceWindow, args, n); >(gdb) s >Warning: Cannot open file /tmp/x.c; Resource temporarily unavailable Something within the X code must be interpreting a zero return from open() as a failure - I've seen this with xxgdb, but rather than digging into the X code I just changed xxgdb to not leave file descriptors 0 and 1 closed. A patch is below. Ian --- orig/calldbx.c Wed Oct 24 12:38:41 2001 +++ calldbx.c Wed Oct 24 12:56:18 2001 @@ -311,6 +311,11 @@ */ close(0); close(1); + if (open("/dev/null", O_RDONLY) < 0 || + open("/dev/null", O_WRONLY) < 0) { + perror("/dev/null"); + exit(1); + } #ifdef _POSIX_SOURCE fcntl(master, F_SETFL, O_NONBLOCK); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message