mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-30 08:03:49 +00:00
fixed bug with mkstemp() on Linux (format must be 6x X, not 5x X).
This commit is contained in:
parent
8ab7cc79b5
commit
b758366cc3
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)
|
||||
return WHY("cannot log backtrace: own executable path unknown");
|
||||
char tempfile[MAXPATHLEN];
|
||||
if (!FORM_SERVAL_INSTANCE_PATH(tempfile, "servalgdb.XXXXX"))
|
||||
if (!FORM_SERVAL_INSTANCE_PATH(tempfile, "servalgdb.XXXXXX"))
|
||||
return -1;
|
||||
int tmpfd = mkstemp(tempfile);
|
||||
if (tmpfd == -1)
|
||||
return WHY_perror("mkstemp");
|
||||
return WHYF_perror("mkstemp(%s)",alloca_str_toprint(tempfile));
|
||||
if (write_str(tmpfd, "backtrace\n") == -1) {
|
||||
close(tmpfd);
|
||||
unlink(tempfile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user