mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-07 11:30:18 +00:00
Fix mkstemp() error in log_backtrace()
The template only had five XXXXX but needed six.
This commit is contained in:
parent
5ee82689d2
commit
ff7a61c5bc
4
log.c
4
log.c
@ -431,11 +431,11 @@ int log_backtrace(struct __sourceloc whence)
|
|||||||
if (get_self_executable_path(execpath, sizeof execpath) == -1)
|
if (get_self_executable_path(execpath, sizeof execpath) == -1)
|
||||||
return WHY("cannot log backtrace: own executable path unknown");
|
return WHY("cannot log backtrace: own executable path unknown");
|
||||||
char tempfile[MAXPATHLEN];
|
char tempfile[MAXPATHLEN];
|
||||||
if (!FORM_SERVAL_INSTANCE_PATH(tempfile, "servalgdb.XXXXX"))
|
if (!FORM_SERVAL_INSTANCE_PATH(tempfile, "servalgdb.XXXXXX"))
|
||||||
return -1;
|
return -1;
|
||||||
int tmpfd = mkstemp(tempfile);
|
int tmpfd = mkstemp(tempfile);
|
||||||
if (tmpfd == -1)
|
if (tmpfd == -1)
|
||||||
return WHY_perror("mkstemp");
|
return WHYF_perror("mkstemp(%s)", alloca_str_toprint(tempfile));
|
||||||
if (write_str(tmpfd, "backtrace\n") == -1) {
|
if (write_str(tmpfd, "backtrace\n") == -1) {
|
||||||
close(tmpfd);
|
close(tmpfd);
|
||||||
unlink(tempfile);
|
unlink(tempfile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user