fix source.c
[deliverable/binutils-gdb.git] / gdb / auto-load.c
index 850c704ebf258e69eea973f791bf87fd404aaa60..d461f2b95b6ffa9bdccec3444b3897a9f471deb6 100644 (file)
@@ -38,6 +38,7 @@
 #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.  */
@@ -178,7 +179,6 @@ auto_load_expand_dir_vars (const char *string)
 static void
 auto_load_safe_path_vec_update (void)
 {
-  VEC (char_ptr) *dir_vec = NULL;
   unsigned len;
   int ix;
 
@@ -739,7 +739,7 @@ auto_load_objfile_script_1 (struct objfile *objfile, const char *realname,
 
   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"),
@@ -771,7 +771,7 @@ auto_load_objfile_script_1 (struct objfile *objfile, const char *realname,
          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"),
This page took 0.039539 seconds and 4 git commands to generate.