mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 15:41:58 -07:00
core: prefer mkdir over create_directory and permissions
This commit is contained in:
@@ -16,6 +16,9 @@
|
||||
#include "protocols/FractionalScale.hpp"
|
||||
#include "protocols/PointerConstraints.hpp"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int handleCritSignal(int signo, void* data) {
|
||||
Debug::log(LOG, "Hyprland received signal {}", signo);
|
||||
|
||||
@@ -63,15 +66,11 @@ CCompositor::CCompositor() {
|
||||
|
||||
setenv("HYPRLAND_INSTANCE_SIGNATURE", m_szInstanceSignature.c_str(), true);
|
||||
|
||||
if (!std::filesystem::exists("/tmp/hypr")) {
|
||||
std::filesystem::create_directory("/tmp/hypr");
|
||||
std::filesystem::permissions("/tmp/hypr", std::filesystem::perms::all | std::filesystem::perms::sticky_bit, std::filesystem::perm_options::replace);
|
||||
}
|
||||
if (!std::filesystem::exists("/tmp/hypr"))
|
||||
mkdir("/tmp/hypr", S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
|
||||
|
||||
const auto INSTANCEPATH = "/tmp/hypr/" + m_szInstanceSignature;
|
||||
std::filesystem::create_directory(INSTANCEPATH);
|
||||
std::filesystem::permissions(INSTANCEPATH, std::filesystem::perms::group_all, std::filesystem::perm_options::replace);
|
||||
std::filesystem::permissions(INSTANCEPATH, std::filesystem::perms::owner_all, std::filesystem::perm_options::add);
|
||||
mkdir(INSTANCEPATH.c_str(), S_IRWXU | S_IRWXG);
|
||||
|
||||
Debug::init(m_szInstanceSignature);
|
||||
|
||||
|
Reference in New Issue
Block a user