/* GDB routines for supporting auto-loaded scripts.
- Copyright (C) 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GDB.
#include "observer.h"
#include "fnmatch.h"
#include "top.h"
+#include "filestuff.h"
/* The suffix of per-objfile scripts to auto-load as non-Python command files.
E.g. When the program loads libfoo.so, look for libfoo-gdb.gdb. */
static void
auto_load_safe_path_vec_update (void)
{
- VEC (char_ptr) *dir_vec = NULL;
unsigned len;
int ix;
cleanups = make_cleanup (xfree, filename);
- input = fopen (filename, "r");
+ input = gdb_fopen_cloexec (filename, "r");
debugfile = filename;
if (debug_auto_load)
fprintf_unfiltered (gdb_stdlog, _("auto-load: Attempted file \"%s\" %s.\n"),
strcat (debugfile, filename);
make_cleanup (xfree, debugfile);
- input = fopen (debugfile, "r");
+ input = gdb_fopen_cloexec (debugfile, "r");
if (debug_auto_load)
fprintf_unfiltered (gdb_stdlog, _("auto-load: Attempted file "
"\"%s\" %s.\n"),