diff --git a/CMakeLists.txt b/CMakeLists.txt index 257ad94..c867001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,13 +44,8 @@ boption(BUILD_TESTING "Build tests (dev)" OFF) boption(ASAN "ASAN (dev)" OFF) # note: better output with gcc than clang boption(FRAME_POINTERS "Keep Frame Pointers (dev)" ${ASAN}) -if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - boption(CRASH_REPORTER "Crash Handling" OFF) - boption(USE_JEMALLOC "Use jemalloc" OFF) -else() - boption(CRASH_REPORTER "Crash Handling" ON) - boption(USE_JEMALLOC "Use jemalloc" ON) -endif() +boption(CRASH_REPORTER "Crash Handling" ON) +boption(USE_JEMALLOC "Use jemalloc" ON) boption(SOCKETS "Unix Sockets" ON) boption(WAYLAND "Wayland" ON) boption(WAYLAND_WLR_LAYERSHELL " Wlroots Layer-Shell" ON REQUIRES WAYLAND) diff --git a/changelog/next.md b/changelog/next.md index 7857103..8a48ba5 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -21,7 +21,6 @@ set shell id. ## Other Changes -- FreeBSD is now partially supported. - IPC operations filter available instances to the current display connection by default. ## Bug Fixes diff --git a/src/core/logging.cpp b/src/core/logging.cpp index 10ea453..5c809f6 100644 --- a/src/core/logging.cpp +++ b/src/core/logging.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "instanceinfo.hpp" #include "logcat.hpp" @@ -392,7 +392,7 @@ void ThreadLogging::initFs() { delete detailedFile; detailedFile = nullptr; } else { - struct flock lock = { + auto lock = flock { .l_type = F_WRLCK, .l_whence = SEEK_SET, .l_start = 0, @@ -414,7 +414,7 @@ void ThreadLogging::initFs() { auto* oldFile = this->file; if (oldFile) { oldFile->seek(0); - copy_file_range(oldFile->handle(), nullptr, file->handle(), nullptr, oldFile->size(), 0); + sendfile(file->handle(), oldFile->handle(), nullptr, oldFile->size()); } this->file = file; @@ -426,14 +426,7 @@ void ThreadLogging::initFs() { auto* oldFile = this->detailedFile; if (oldFile) { oldFile->seek(0); - copy_file_range( - oldFile->handle(), - nullptr, - detailedFile->handle(), - nullptr, - oldFile->size(), - 0 - ); + sendfile(detailedFile->handle(), oldFile->handle(), nullptr, oldFile->size()); } crash::CrashInfo::INSTANCE.logFd = detailedFile->handle(); @@ -896,7 +889,7 @@ bool LogReader::continueReading() { } void LogFollower::FcntlWaitThread::run() { - struct flock lock = { + auto lock = flock { .l_type = F_RDLCK, // won't block other read locks when we take it .l_whence = SEEK_SET, .l_start = 0, diff --git a/src/core/paths.cpp b/src/core/paths.cpp index 6555e54..55beb87 100644 --- a/src/core/paths.cpp +++ b/src/core/paths.cpp @@ -361,7 +361,7 @@ void QsPaths::createLock() { return; } - struct flock lock = { + auto lock = flock { .l_type = F_WRLCK, .l_whence = SEEK_SET, .l_start = 0, @@ -389,7 +389,7 @@ bool QsPaths::checkLock(const QString& path, InstanceLockInfo* info, bool allowD auto file = QFile(QDir(path).filePath("instance.lock")); if (!file.open(QFile::ReadOnly)) return false; - struct flock lock = { + auto lock = flock { .l_type = F_WRLCK, .l_whence = SEEK_SET, .l_start = 0, diff --git a/src/core/toolsupport.cpp b/src/core/toolsupport.cpp index 8aa5ac9..afce008 100644 --- a/src/core/toolsupport.cpp +++ b/src/core/toolsupport.cpp @@ -54,7 +54,7 @@ bool QmlToolingSupport::lockTooling() { return false; } - struct flock lock = { + auto lock = flock { .l_type = F_WRLCK, .l_whence = SEEK_SET, // NOLINT (fcntl.h??) .l_start = 0, diff --git a/src/io/process.hpp b/src/io/process.hpp index 3c55745..ab8763e 100644 --- a/src/io/process.hpp +++ b/src/io/process.hpp @@ -102,7 +102,7 @@ class Process: public PostReloadHook { /// If the process is already running changing this property will affect the next /// started process. If the property has been changed after starting a process it will /// return the new value, not the one for the currently running process. - Q_PROPERTY(QVariantHash environment READ environment WRITE setEnvironment NOTIFY environmentChanged); + Q_PROPERTY(QHash environment READ environment WRITE setEnvironment NOTIFY environmentChanged); /// If the process's environment should be cleared prior to applying @@environment. /// Defaults to false. /// diff --git a/src/io/processcore.hpp b/src/io/processcore.hpp index 8d566c9..37ec409 100644 --- a/src/io/processcore.hpp +++ b/src/io/processcore.hpp @@ -13,7 +13,7 @@ namespace qs::io::process { class ProcessContext { Q_PROPERTY(QList command MEMBER command WRITE setCommand); - Q_PROPERTY(QVariantHash environment MEMBER environment WRITE setEnvironment); + Q_PROPERTY(QHash environment MEMBER environment WRITE setEnvironment); Q_PROPERTY(bool clearEnvironment MEMBER clearEnvironment WRITE setClearEnvironment); Q_PROPERTY(QString workingDirectory MEMBER workingDirectory WRITE setWorkingDirectory); Q_PROPERTY(bool unbindStdout MEMBER unbindStdout WRITE setUnbindStdout); diff --git a/src/services/pam/conversation.cpp b/src/services/pam/conversation.cpp index 500abd5..6d27978 100644 --- a/src/services/pam/conversation.cpp +++ b/src/services/pam/conversation.cpp @@ -6,8 +6,6 @@ #include #include #include -#include -#include #include #include "../../core/logcat.hpp" diff --git a/src/services/pam/qml.hpp b/src/services/pam/qml.hpp index a36184e..a8ffcc3 100644 --- a/src/services/pam/qml.hpp +++ b/src/services/pam/qml.hpp @@ -6,11 +6,7 @@ #include #include #include -#ifdef __FreeBSD__ -#include -#else #include -#endif #include #include "conversation.hpp" @@ -39,8 +35,6 @@ class PamContext /// /// The configuration directory is resolved relative to the current file if not an absolute path. /// - /// On FreeBSD this property is ignored as the pam configuration directory cannot be changed. - /// /// This property may not be set while @@active is true. Q_PROPERTY(QString configDirectory READ configDirectory WRITE setConfigDirectory NOTIFY configDirectoryChanged); /// The user to authenticate as. If unset the current user will be used. diff --git a/src/services/pam/subprocess.cpp b/src/services/pam/subprocess.cpp index dc36228..f99b279 100644 --- a/src/services/pam/subprocess.cpp +++ b/src/services/pam/subprocess.cpp @@ -7,11 +7,7 @@ #include #include #include -#ifdef __FreeBSD__ -#include -#else #include -#endif #include #include @@ -87,11 +83,7 @@ PamIpcExitCode PamSubprocess::exec(const char* configDir, const char* config, co logIf(this->log) << "Starting pam session for user \"" << user << "\" with config \"" << config << "\" in dir \"" << configDir << "\"" << std::endl; -#ifdef __FreeBSD__ - auto result = pam_start(config, user, &conv, &handle); -#else auto result = pam_start_confdir(config, user, &conv, configDir, &handle); -#endif if (result != PAM_SUCCESS) { logIf(true) << "Unable to start pam conversation with error \"" << pam_strerror(handle, result)