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:
parent
b1e5cc66bd
commit
8bbeee1173
118 changed files with 720 additions and 679 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue