From 8129afdd1f37d086daaf6b9a3446475e4f6671dd Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 3 Dec 2017 10:11:54 +0200 Subject: [PATCH] Fixed compilation of non-Windows targets These are quick hacks to be improved later --- src/resourcefiles/file_directory.cpp | 5 ++++- src/tmpfileplus.cpp | 6 ------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/resourcefiles/file_directory.cpp b/src/resourcefiles/file_directory.cpp index 02c70a21e3..77e5d0141e 100644 --- a/src/resourcefiles/file_directory.cpp +++ b/src/resourcefiles/file_directory.cpp @@ -209,7 +209,10 @@ int FDirectory::AddDirectory(const char *dirpath) FString fullFileName = scanDirectories[i] + file->d_name; - if(DirExists(fullFileName.GetChars())) + struct stat fileStat; + stat(fullFileName.GetChars(), &fileStat); + + if(S_ISDIR(fileStat.st_mode)) { scanDirectories.Push(scanDirectories[i] + file->d_name + "/"); continue; diff --git a/src/tmpfileplus.cpp b/src/tmpfileplus.cpp index bfe021dbb3..2085e8be3b 100644 --- a/src/tmpfileplus.cpp +++ b/src/tmpfileplus.cpp @@ -172,12 +172,6 @@ static FILE *mktempfile_internal(const char *tmpdir, const char *pfx, FString *t { /* Success, so return user a proper ANSI C file pointer */ fp = FDOPEN_(fd, "w+b"); errno = 0; - -#ifndef _WIN32 - /* [Unix only] And make sure the file will be deleted once closed */ - if (!keep) remove(tmpname); -#endif - } else { /* We failed */