forked from Imagelibrary/binutils-gdb
gdb/
* ctf.c: Include "gdb_stat.h". [USE_WIN32API]: New macro 'mkdir'. (ctf_start): Use permission bits macros if they are defined.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2013-03-21 Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
|
* ctf.c: Include "gdb_stat.h".
|
||||||
|
[USE_WIN32API]: New macro 'mkdir'.
|
||||||
|
(ctf_start): Use permission bits macros if they are defined.
|
||||||
|
|
||||||
2013-03-20 Keith Seitz <keiths@redhat.com>
|
2013-03-20 Keith Seitz <keiths@redhat.com>
|
||||||
|
|
||||||
* breakpoint.h (struct breakpoint): Add comment to
|
* breakpoint.h (struct breakpoint): Add comment to
|
||||||
|
|||||||
20
gdb/ctf.c
20
gdb/ctf.c
@@ -23,6 +23,7 @@
|
|||||||
#include "ctf.h"
|
#include "ctf.h"
|
||||||
#include "tracepoint.h"
|
#include "tracepoint.h"
|
||||||
#include "regcache.h"
|
#include "regcache.h"
|
||||||
|
#include "gdb_stat.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
@@ -270,6 +271,10 @@ ctf_target_save (struct trace_file_writer *self,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_WIN32API
|
||||||
|
#define mkdir(pathname, mode) _mkdir (pathname)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is the implementation of trace_file_write_ops method
|
/* This is the implementation of trace_file_write_ops method
|
||||||
start. It creates the directory DIRNAME, metadata and datastream
|
start. It creates the directory DIRNAME, metadata and datastream
|
||||||
in the directory. */
|
in the directory. */
|
||||||
@@ -282,10 +287,21 @@ ctf_start (struct trace_file_writer *self, const char *dirname)
|
|||||||
struct ctf_trace_file_writer *writer
|
struct ctf_trace_file_writer *writer
|
||||||
= (struct ctf_trace_file_writer *) self;
|
= (struct ctf_trace_file_writer *) self;
|
||||||
int i;
|
int i;
|
||||||
|
mode_t hmode = S_IRUSR | S_IWUSR | S_IXUSR
|
||||||
|
#ifdef S_IRGRP
|
||||||
|
| S_IRGRP
|
||||||
|
#endif
|
||||||
|
#ifdef S_IXGRP
|
||||||
|
| S_IXGRP
|
||||||
|
#endif
|
||||||
|
| S_IROTH /* Defined in common/gdb_stat.h if not defined. */
|
||||||
|
#ifdef S_IXOTH
|
||||||
|
| S_IXOTH
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
/* Create DIRNAME. */
|
/* Create DIRNAME. */
|
||||||
if (mkdir (dirname, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
|
if (mkdir (dirname, hmode) && errno != EEXIST)
|
||||||
&& errno != EEXIST)
|
|
||||||
error (_("Unable to open directory '%s' for saving trace data (%s)"),
|
error (_("Unable to open directory '%s' for saving trace data (%s)"),
|
||||||
dirname, safe_strerror (errno));
|
dirname, safe_strerror (errno));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user