#include "probe.h"
#include "ctf.h"
#include "completer.h"
+#include "filestuff.h"
/* readline include files */
#include "readline/readline.h"
= (struct tfile_trace_file_writer *) self;
writer->pathname = tilde_expand (filename);
- writer->fp = fopen (writer->pathname, "wb");
+ writer->fp = gdb_fopen_cloexec (writer->pathname, "wb");
if (writer->fp == NULL)
error (_("Unable to open file '%s' for saving trace data (%s)"),
filename, safe_strerror (errno));
target is losing, we can get out without touching files. */
status = target_get_trace_status (ts);
- writer->ops->start (writer, filename);
-
writer->ops->write_header (writer);
/* Write descriptive info. */
flags = O_BINARY | O_LARGEFILE;
flags |= O_RDONLY;
- scratch_chan = open (filename, flags, 0);
+ scratch_chan = gdb_open_cloexec (filename, flags, 0);
if (scratch_chan < 0)
perror_with_name (filename);