From 8bbeee11734d3ba8e2cf15d19cb3c302f8bfdbf2 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 7 Dec 2024 18:51:18 +0100 Subject: core: Add clang-tidy (#8664) This adds a .clang-tidy file for us. It's not a strict requirement to be compliant, but I tuned it to be alright. --- src/xwayland/Server.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/xwayland/Server.cpp') diff --git a/src/xwayland/Server.cpp b/src/xwayland/Server.cpp index f356af18..9d6b3bcb 100644 --- a/src/xwayland/Server.cpp +++ b/src/xwayland/Server.cpp @@ -3,14 +3,13 @@ #include #include -#include +#include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include #include #include #include @@ -94,7 +93,7 @@ static int createSocket(struct sockaddr_un* addr, size_t path_size) { return fd; } -static bool checkPermissionsForSocketDir(void) { +static bool checkPermissionsForSocketDir() { struct stat buf; if (lstat("/tmp/.X11-unix", &buf)) { @@ -107,7 +106,7 @@ static bool checkPermissionsForSocketDir(void) { return false; } - if (!((buf.st_uid == 0) || (buf.st_uid == getuid()))) { + if ((buf.st_uid != 0) && (buf.st_uid != getuid())) { Debug::log(ERR, "X11 socket dir is not owned by root or current user"); return false; } -- cgit v1.2.3