+2017-04-05 Pedro Alves <palves@redhat.com>
+
+ * proc-api.c (procfs_filename): Don't initialize
+ procfs_filename.
+ (prepare_to_trace): Assume procfs_filename is non-NULL.
+ (_initialize_proc_api): Give procfs_filename a default value here.
+
2017-04-05 Pedro Alves <palves@redhat.com>
* break-catch-throw.c (handle_gnu_v3_exceptions): Constify
static int procfs_trace = 0;
static FILE *procfs_file = NULL;
-static char *procfs_filename = "procfs_trace";
+static char *procfs_filename;
static void
prepare_to_trace (void)
{
if (procfs_trace) /* if procfs tracing turned on */
if (procfs_file == NULL) /* if output file not yet open */
- if (procfs_filename != NULL) /* if output filename known */
- procfs_file = fopen (procfs_filename, "a"); /* open output file */
+ procfs_file = fopen (procfs_filename, "a"); /* open output file */
}
static void
NULL, /* FIXME: i18n: */
&setlist, &showlist);
+ procfs_filename = xstrdup ("procfs_trace");
add_setshow_filename_cmd ("procfs-file", no_class, &procfs_filename, _("\
Set filename for /proc tracefile."), _("\
Show filename for /proc tracefile."), NULL,