PR gdb/7912:
[deliverable/binutils-gdb.git] / gdb / auto-load.c
index b12995b652a15c160d3faa8bb2b73ed8e7348f77..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.  */
@@ -738,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"),
@@ -770,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.02512 seconds and 4 git commands to generate.