mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-21 06:53:48 -07:00
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.
This commit is contained in:
@@ -3,14 +3,13 @@
|
||||
|
||||
#include <format>
|
||||
#include <string>
|
||||
#include <errno.h>
|
||||
#include <cerrno>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <signal.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <csignal>
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
#include <exception>
|
||||
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user