public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gold patch committed: Check that options are valid before using them
@ 2009-03-19 19:04 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2009-03-19 19:04 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

In my recent patch to set the close-on-exec flags for descriptors, I
forgot to check that the options are valid before checking whether there
are any plugins.  I committed this patch to fix that oversight.

Ian


2009-03-19  Ian Lance Taylor  <iant@google.com>

	* descriptors.cc (Descriptors::open): Check that the options are
	valid before using them.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Check that options are valid before using them --]
[-- Type: text/x-patch, Size: 764 bytes --]

Index: descriptors.cc
===================================================================
RCS file: /cvs/src/src/gold/descriptors.cc,v
retrieving revision 1.5
diff -u -u -p -r1.5 descriptors.cc
--- descriptors.cc	17 Mar 2009 17:09:44 -0000	1.5
+++ descriptors.cc	19 Mar 2009 19:02:33 -0000
@@ -130,7 +130,9 @@ Descriptors::open(int descriptor, const 
 	  // 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);
 
 	  {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-19 19:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-19 19:04 gold patch committed: Check that options are valid before using them Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).