Date: Wed, 24 Oct 2001 11:10:01 -0700 (PDT) From: "Jin Guojun[ITG]" <j_guojun@lbl.gov> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/30993: xxgdb cannot open source file Message-ID: <200110241810.f9OIA1O76015@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/30993; it has been noted by GNATS.
From: "Jin Guojun[ITG]" <j_guojun@lbl.gov>
To: freebsd-gnats-submit@FreeBSD.org,
Ian Dowse <iedowse@maths.tcd.ie>
Cc:
Subject: Re: bin/30993: xxgdb cannot open source file
Date: Wed, 24 Oct 2001 11:05:33 -0700
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);
This is an interesting solution that works.
Thanks,
--
------------ Jin Guojun ----------- v --- j_guojun@lbl.gov ---
Distributed Systems Department http://www.itg.lbl.gov/~jin
M/S 50B-2239 Ph#:(510) 486-7531 Fax: 486-6363
Lawrence Berkeley National Laboratory, Berkeley, CA 94720
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110241810.f9OIA1O76015>
