This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Minor O_CLOEXEC optimization, "regression" fix


> Date: Wed, 9 Oct 2013 15:10:16 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
> 
> On Tue, 08 Oct 2013 21:44:33 +0200, Tom Tromey wrote:
> > >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> > Jan> -  if (result == NULL)
> > Jan> +  if (result != NULL)
> > Jan> +    fopen_e_ever_succeeded = 1;
> > Jan> +  else if (!fopen_e_ever_succeeded)
> > 
> > What if we have it check for EINVAL instead?
> 
> May one rely on MS-Windows fopen("","re") will fail with EINVAL if it fails
> because of the "e" flag, Kai?  It is in GDB function gdb_fopen_cloexec.

Please don't do that.  On latest versions of Windows, the runtime
library functions tend to invoke the "invalid parameter handler" in
these cases, which more often than not will crash the program.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]