mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Replaced tmpnam by mkstemp
This commit is contained in:
parent
5165daf35c
commit
ab9e8877e2
@ -939,10 +939,13 @@ int my_shell(char *cmd, char *result, int size)
|
||||
char str[1024];
|
||||
char tmp_filename[1024];
|
||||
|
||||
if (tmpnam(tmp_filename)==NULL) {
|
||||
strlcpy(tmp_filename, "/tmp/elog_XXXXXX", sizeof(tmp_filename));
|
||||
fh = mkstemp(tmp_filename);
|
||||
if (fh == 0) {
|
||||
eprintf("Error getting TMP file name.\n");
|
||||
return 0;
|
||||
}
|
||||
close(fh);
|
||||
|
||||
if ((child_pid = fork()) < 0)
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user