kernel: add __poll_t compat for pre-4.16 and backported kernels (#194)
__poll_t was introduced in v4.16-rc1. Add Makefile header check to detect and provide fallback for older kernels and those with backports. Signed-off-by: AzyrRuthless <azyrruthless@tutamail.com>
This commit is contained in:
@@ -119,6 +119,11 @@ ifeq ($(shell grep -q "inode_security_struct\s\+\*selinux_inode" $(srctree)/secu
|
||||
ccflags-y += -DKSU_OPTIONAL_SELINUX_INODE
|
||||
endif
|
||||
|
||||
# Check if __poll_t is available
|
||||
ifeq ($(shell grep -q "__poll_t" $(srctree)/include/linux/poll.h; echo $$?),1)
|
||||
ccflags-y += -DKSU_NEED_POLL_T_DEF
|
||||
endif
|
||||
|
||||
# Checks Samsung
|
||||
ifeq ($(shell grep -q "CONFIG_KDP_CRED" $(srctree)/kernel/cred.c; echo $$?),0)
|
||||
ccflags-y += -DSAMSUNG_UH_DRIVER_EXIST
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
|
||||
#include "file_wrapper.h"
|
||||
|
||||
#ifdef KSU_NEED_POLL_T_DEF
|
||||
typedef unsigned __bitwise __poll_t;
|
||||
#endif
|
||||
|
||||
static loff_t mksu_wrapper_llseek(struct file *fp, loff_t off, int flags)
|
||||
{
|
||||
struct ksu_file_wrapper *data = fp->private_data;
|
||||
|
||||
Reference in New Issue
Block a user