Portability: Don't use mkdtemp() when mkdir() will suffice.
If we can't create the dir, just give up.
This commit is contained in:
parent
1df7aefccf
commit
76aa565c72
@ -130,9 +130,9 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
now = time(NULL);
|
||||
strftime(tmpdir, sizeof(tmpdir),
|
||||
"/tmp/libarchive_test.%Y-%m-%dT%H.%M.%S.XXXXXX",
|
||||
"/tmp/libarchive_test.%Y-%m-%dT%H.%M.%S",
|
||||
localtime(&now));
|
||||
if (mkdtemp(tmpdir) == NULL) {
|
||||
if (mkdir(tmpdir,0755) != 0) {
|
||||
fprintf(stderr, "ERROR: Unable to create temp directory %s\n",
|
||||
tmpdir);
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user