aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2013-09-14 06:26:35 +0000
committerPierre Muller <muller@sourceware.org>2013-09-14 06:26:35 +0000
commit88505fac1ca9ffbe312908898d62d04d18a9bf47 (patch)
tree57461098e025643204a03d23553b793fa6906033 /gdb
parent556a4ec59c2c73d23cb7f48fc83f4746fe1313e0 (diff)
downloadgdb-88505fac1ca9ffbe312908898d62d04d18a9bf47.zip
gdb-88505fac1ca9ffbe312908898d62d04d18a9bf47.tar.gz
gdb-88505fac1ca9ffbe312908898d62d04d18a9bf47.tar.bz2
* common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e"
mode if operating system doesn't know O_CLOEXEC.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/common/filestuff.c8
2 files changed, 14 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 54c37ab..dd25f6a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2013-09-14 Pierre Muller <muller@sourceware.org>
+ Tom Tromey <tromey@redhat.com>
+ Pedro Alves <palves@redhat.com>
+
+ * common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e"
+ mode if operating system doesn't know O_CLOEXEC.
+
2013-09-13 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup.
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index 7d1a69a..d3b13e8 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -311,7 +311,13 @@ FILE *
gdb_fopen_cloexec (const char *filename, const char *opentype)
{
FILE *result = NULL;
- static int fopen_e_ever_failed;
+ /* Probe for "e" support once. But, if we can tell the operating
+ system doesn't know about close on exec mode "e" without probing,
+ skip it. E.g., the Windows runtime issues an "Invalid parameter
+ passed to C runtime function" OutputDebugString warning for
+ unknown modes. Assume that if O_CLOEXEC is zero, then "e" isn't
+ supported. */
+ static int fopen_e_ever_failed = O_CLOEXEC == 0;
if (!fopen_e_ever_failed)
{