From 604399204f1a6e09056023af6d315dc25e8c6963 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 19 Mar 2009 19:02:53 +0000 Subject: * descriptors.cc (Descriptors::open): Check that the options are valid before using them. --- gold/descriptors.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gold/descriptors.cc') 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); { -- cgit v1.1