2002-01-07 Michael Snyder <msnyder@redhat.com>

* tracepoint.c (tracepoint_save_command): From Klee Deines --
	use tilde_expand and strerror for opening save-tracepoints file.
This commit is contained in:
Michael Snyder
2002-01-08 01:52:12 +00:00
parent 5bbd998e61
commit 21c1c9207f
2 changed files with 10 additions and 4 deletions

View File

@ -2263,7 +2263,7 @@ tracepoint_save_command (char *args, int from_tty)
struct action_line *line;
FILE *fp;
char *i1 = " ", *i2 = " ";
char *indent, *actionline;
char *indent, *actionline, *pathname;
char tmp[40];
if (args == 0 || *args == 0)
@ -2275,9 +2275,12 @@ tracepoint_save_command (char *args, int from_tty)
return;
}
if (!(fp = fopen (args, "w")))
error ("Unable to open file '%s' for saving tracepoints");
pathname = tilde_expand (args);
if (!(fp = fopen (pathname, "w")))
error ("Unable to open file '%s' for saving tracepoints (%s)",
args, strerror (errno));
xfree (pathname);
ALL_TRACEPOINTS (tp)
{
if (tp->addr_string)