Commit d7f52197 authored by John van Groningen's avatar John van Groningen
Browse files

use mkstemp instead of tempnam to prevent warnings from gcc

and linker
parent 58e35af3
......@@ -186,7 +186,20 @@ int start_caching_compiler (CleanCharArray cocl_path)
if (compiler_commands_name == NULL)
{
#if 1
static char compiler_commands_file_name[]="/tmp/comXXXXXX";
int fd;
fd=mkstemp (compiler_commands_file_name);
if (fd<0){
perror ("clm: mkstemp failed");
}
close (fd);
unlink (compiler_commands_file_name);
compiler_commands_name=compiler_commands_file_name;
#else
compiler_commands_name=tempnam (NULL, "com");
#endif
if (mkfifo(compiler_commands_name, S_IRUSR | S_IWUSR)) {
perror("clm: mkfifo compiler commands pipe");
compiler_commands_name=NULL;
......@@ -196,7 +209,20 @@ int start_caching_compiler (CleanCharArray cocl_path)
if (compiler_results_name == NULL)
{
#if 1
static char compiler_results_file_name[]="/tmp/resXXXXXX";
int fd;
fd=mkstemp (compiler_results_file_name);
if (fd<0){
perror ("clm: mkstemp failed");
}
close (fd);
unlink (compiler_results_file_name);
compiler_results_name=compiler_results_file_name;
#else
compiler_results_name=tempnam (NULL, "res");
#endif
if (mkfifo(compiler_results_name, S_IRUSR | S_IWUSR)) {
perror("clm: mkfifo compiler results pipe");
compiler_results_name=NULL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment