Skip to content

Commit

Permalink
replace mktemp by mkstemp
Browse files Browse the repository at this point in the history
fix warning: the use of `mktemp' is dangerous
  • Loading branch information
p-alik committed Nov 20, 2018
1 parent 6565633 commit aec4852
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/signal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@ SignalThread::SignalThread(bool exit_on_signal_arg) :
sigaddset(&set, SIGUSR2);

strcpy(lock_name, "/XXXXXXXXX");
mktemp(lock_name);
if (mkstemp(lock_name) == -1)
{
// it doesn't matter
// mkstemp should get random lock_name
// std::cerr << strerror(errno) << " mkstemp failed.";
}
}


Expand Down

0 comments on commit aec4852

Please sign in to comment.