diff --git a/kernel/Makefile b/kernel/Makefile index 6be57b2c..4e377e52 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -180,4 +180,9 @@ else $(info -- You have not integrated susfs in your kernel yet.) $(info -- Read: https://gitlab.com/simonpunk/susfs4ksu) endif + +# Function proc_ops check +ifeq ($(shell grep -q "struct proc_ops " $(srctree)/include/linux/proc_fs.h; echo $$?),0) +ccflags-y += -DKSU_COMPAT_HAS_PROC_OPS +endif # Keep a new line here!! Because someone may append config diff --git a/kernel/throne_comm.c b/kernel/throne_comm.c index 7e4fcf2b..10342347 100644 --- a/kernel/throne_comm.c +++ b/kernel/throne_comm.c @@ -78,7 +78,7 @@ static ssize_t uid_scanner_write(struct file *file, const char __user *buffer, return count; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) +#ifdef KSU_COMPAT_HAS_PROC_OPS static const struct proc_ops uid_scanner_proc_ops = { .proc_open = uid_scanner_open, .proc_read = seq_read, @@ -133,4 +133,4 @@ void ksu_throne_comm_exit(void) } pr_info("throne communication cleaned up\n"); -} \ No newline at end of file +}