diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-04 10:22:29 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-04 10:22:29 +0200 |
commit | 9928cdc2e721bb85fdc09807b8d2c777aa212757 (patch) | |
tree | 7fc3b34089a7f3a923e670efbf97b36d30e92c06 /drivers/unix/file_access_unix.cpp | |
parent | cd7f172cf8b5706db08633662711fcc6027086bd (diff) | |
parent | f501e4f665cac2f14cd43ae713283cf91ad03d09 (diff) | |
download | redot-engine-9928cdc2e721bb85fdc09807b8d2c777aa212757.tar.gz |
Merge pull request #66807 from akien-mga/core-unix-remove-NO_FCNTL-and-NO_STATVFS
Unix: Remove now unnecessary I/O defines, cleanup
Diffstat (limited to 'drivers/unix/file_access_unix.cpp')
-rw-r--r-- | drivers/unix/file_access_unix.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 300fbcdcfd..0df645c4e5 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -30,24 +30,20 @@ #include "file_access_unix.h" -#if defined(UNIX_ENABLED) || defined(LIBC_FILEIO_ENABLED) +#if defined(UNIX_ENABLED) #include "core/os/os.h" #include "core/string/print_string.h" +#include <errno.h> +#include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> -#include <errno.h> - #if defined(UNIX_ENABLED) #include <unistd.h> #endif -#ifndef ANDROID_ENABLED -#include <sys/statvfs.h> -#endif - #ifdef MSVC #define S_ISREG(m) ((m)&_S_IFREG) #include <io.h> @@ -56,12 +52,6 @@ #define S_ISREG(m) ((m)&S_IFREG) #endif -#ifndef NO_FCNTL -#include <fcntl.h> -#else -#include <sys/ioctl.h> -#endif - void FileAccessUnix::check_errors() const { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); @@ -131,13 +121,8 @@ Error FileAccessUnix::open_internal(const String &p_path, int p_mode_flags) { int fd = fileno(f); if (fd != -1) { -#if defined(NO_FCNTL) - unsigned long par = 0; - ioctl(fd, FIOCLEX, &par); -#else int opts = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, opts | FD_CLOEXEC); -#endif } last_error = OK; @@ -339,4 +324,4 @@ FileAccessUnix::~FileAccessUnix() { _close(); } -#endif // UNIX_ENABLED || LIBC_FILEIO_ENABLED +#endif // UNIX_ENABLED |