Skip to content

Commit

Permalink
Fix compiler warning generated by extensions/trace.c when compiled
Browse files Browse the repository at this point in the history
with gcc version 5.  Without the patch, the message "warning: the
use of 'mktemp' is dangerous, better use 'mkstemp'" is generated.
(anderson@redhat.com)
  • Loading branch information
Dave Anderson committed Jul 8, 2015
1 parent 39fa580 commit 203853b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extensions/trace.c
Expand Up @@ -1533,7 +1533,6 @@ static void ftrace_show(int argc, char *argv[])
FILE *file;
size_t ret;
size_t nitems __attribute__ ((__unused__));
char *unused __attribute__ ((__unused__));

/* check trace-cmd */
if (env_trace_cmd)
Expand All @@ -1557,8 +1556,9 @@ static void ftrace_show(int argc, char *argv[])
}

/* dump trace.dat to the temp file */
unused = mktemp(tmp);
fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 0644);
fd = mkstemp(tmp);
if (fd < 0)
return;
if (trace_cmd_data_output(fd) < 0)
goto out;

Expand Down

0 comments on commit 203853b

Please sign in to comment.