aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-03-19 19:02:53 +0000
committerIan Lance Taylor <ian@airs.com>2009-03-19 19:02:53 +0000
commit604399204f1a6e09056023af6d315dc25e8c6963 (patch)
treebb3b9dc06aa3ca86e7899cefb97e35d318905073 /gold
parent16ad93705cfed2630f48ba44b7dde9d20a4c6f44 (diff)
downloadgdb-604399204f1a6e09056023af6d315dc25e8c6963.zip
gdb-604399204f1a6e09056023af6d315dc25e8c6963.tar.gz
gdb-604399204f1a6e09056023af6d315dc25e8c6963.tar.bz2
* descriptors.cc (Descriptors::open): Check that the options are
valid before using them.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/descriptors.cc4
2 files changed, 8 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 9dd8787..96abf8a 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-19 Ian Lance Taylor <iant@google.com>
+
+ * descriptors.cc (Descriptors::open): Check that the options are
+ valid before using them.
+
2009-03-18 Ian Lance Taylor <iant@google.com>
* script-sections.h: Include <list>.
diff --git a/gold/descriptors.cc b/gold/descriptors.cc
index 6937741..b05bdf1 100644
--- a/gold/descriptors.cc
+++ b/gold/descriptors.cc
@@ -130,7 +130,9 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode)
// header file but not supported by the kernel.
// Unfortunately there doesn't seem to be any obvious way to
// detect that, as unknown flags passed to open are ignored.
- if (O_CLOEXEC == 0 && parameters->options().has_plugins())
+ if (O_CLOEXEC == 0
+ && parameters->options_valid()
+ && parameters->options().has_plugins())
fcntl(new_descriptor, F_SETFD, FD_CLOEXEC);
{