integ/filesystem/parted/centos/patches/syscalls.patch
slin14 b2b11f8a0e de-fuzz parted patches
When do Centos 7.5 upgraded, some patches didn't resolve and cause
the fuzzy in the line numbers of the patches. And it may cause
.orig file is created when do patch. And this .orig file will lead
to rpm packaging failure due to the unexpected and unpackaged .orig
file.

Please visit below link to get more detail info:
https://bugs.launchpad.net/starlingx/+bug/1794611

Solution:
  Safest solution is to de-fuzz our patches.

Story: 2003389
Task: 26755

Change-Id: I3e54f61b200c71c1900fa48d29a43e08c70688d0
Signed-off-by: slin14 <shuicheng.lin@intel.com>
2018-09-28 07:53:33 +08:00

53 lines
1.6 KiB
Diff

From 0da33d97a8c20125922b5967988a2849d801ca0c Mon Sep 17 00:00:00 2001
From: Allain Legacy <allain.legacy@windriver.com>
Date: Fri, 28 Sep 2018 02:28:30 +0800
Subject:
---
libparted/arch/linux.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 6e78faf..27f706b 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -1673,12 +1673,14 @@ _device_close (PedDevice* dev)
#if SIZEOF_OFF_T < 8
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static _syscall5(int,_llseek,
unsigned int, fd,
unsigned long, offset_high,
unsigned long, offset_low,
loff_t*, result,
unsigned int, origin)
+#endif
loff_t
llseek (unsigned int fd, loff_t offset, unsigned int whence)
@@ -1686,11 +1688,20 @@ llseek (unsigned int fd, loff_t offset, unsigned int whence)
loff_t result;
int retval;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
retval = _llseek(fd,
((unsigned long long)offset) >> 32,
((unsigned long long)offset) & 0xffffffff,
&result,
whence);
+#else
+ retval = syscall(__NR__llseek, fd,
+ ((unsigned long long)offset) >> 32,
+ ((unsigned long long)offset) & 0xffffffff,
+ &result,
+ whence);
+#endif
+
return (retval==-1 ? (loff_t) retval : result);
}
--
2.7.4