From 0394077f8f69f8aa0fdcbdb4c2b21d5e5c933ef8 Mon Sep 17 00:00:00 2001 From: kautism Date: Mon, 31 Oct 2022 13:50:09 +0800 Subject: [PATCH] Fix build error in Centos 8 4.18.0-408.el8.x86_64 --- binder/binder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/binder/binder.c b/binder/binder.c index d3829a0..fce74a1 100644 --- a/binder/binder.c +++ b/binder/binder.c @@ -464,7 +464,11 @@ static long task_close_fd(struct binder_proc *proc, unsigned int fd) if (proc->files == NULL) return -ESRCH; +#if defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2055 + retval = close_fd(fd); +#else retval = __close_fd(proc->files, fd); +#endif /* can't restart close syscall because file table entry was cleared */ if (unlikely(retval == -ERESTARTSYS || retval == -ERESTARTNOINTR || @@ -3391,7 +3395,7 @@ static void binder_vma_close(struct vm_area_struct *vma) binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || ( defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2055 ) static vm_fault_t binder_vm_fault(struct vm_fault *vmf) #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) static int binder_vm_fault(struct vm_fault *vmf)