diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-12-16 19:04:43 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-12-17 11:01:26 -0800 |
commit | 4580e951a19a81ebbd0fd9705311c4b7d70cef73 (patch) | |
tree | d9ea7479ec618386e0568fe39cf2fc0b465b92a9 | |
parent | 2667da1ea72b725021d28bce37173e09e6a75001 (diff) | |
download | meta-openembedded-4580e951a19a81ebbd0fd9705311c4b7d70cef73.tar.gz |
fatcat: Enable 64bit off_t
Replace lseek64 with lseek
Update patch status accordingly
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 73 insertions, 1 deletions
diff --git a/meta-filesystems/recipes-utils/fatcat/fatcat/0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch b/meta-filesystems/recipes-utils/fatcat/fatcat/0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch index fd8e22abca..7e215e3080 100644 --- a/meta-filesystems/recipes-utils/fatcat/fatcat/0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch +++ b/meta-filesystems/recipes-utils/fatcat/fatcat/0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch | |||
@@ -8,8 +8,8 @@ of any of the GNU specific argp extensions. Include unistd.h directly to | |||
8 | allow building with musl on linux, whilst retaining compatibility with | 8 | allow building with musl on linux, whilst retaining compatibility with |
9 | glibc and other unices. | 9 | glibc and other unices. |
10 | 10 | ||
11 | Upstream-status: Submitted [https://github.com/Gregwar/fatcat/pull/34] | ||
11 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | 12 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> |
12 | Upstream-status: Pending | ||
13 | --- | 13 | --- |
14 | src/fatcat.cpp | 8 ++------ | 14 | src/fatcat.cpp | 8 ++------ |
15 | 1 file changed, 2 insertions(+), 6 deletions(-) | 15 | 1 file changed, 2 insertions(+), 6 deletions(-) |
diff --git a/meta-filesystems/recipes-utils/fatcat/fatcat/0002-Enable-64bit-off_t.patch b/meta-filesystems/recipes-utils/fatcat/fatcat/0002-Enable-64bit-off_t.patch new file mode 100644 index 0000000000..caaf105eea --- /dev/null +++ b/meta-filesystems/recipes-utils/fatcat/fatcat/0002-Enable-64bit-off_t.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From 0383fff94471278c92ef2ad5edc14abbb40a9acd Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 16 Dec 2022 18:54:55 -0800 | ||
4 | Subject: [PATCH] Enable 64bit off_t | ||
5 | |||
6 | Ensure that off_t is always 64-bit by specifying -D_LARGEFILE_SOURCE | ||
7 | -D_FILE_OFFSET_BITS=64 this will ensure that normal lseek() function is | ||
8 | same as lseek64 | ||
9 | |||
10 | This helps compiling on latest musl where lseek64 and friends are not | ||
11 | available | ||
12 | |||
13 | Upstream-status: Submitted [https://github.com/Gregwar/fatcat/pull/34] | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | CMakeLists.txt | 2 ++ | ||
17 | src/core/FatSystem.cpp | 4 ++-- | ||
18 | src/core/FatSystem.h | 2 -- | ||
19 | 3 files changed, 4 insertions(+), 4 deletions(-) | ||
20 | |||
21 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
22 | index d6a2649..4cdd1fb 100644 | ||
23 | --- a/CMakeLists.txt | ||
24 | +++ b/CMakeLists.txt | ||
25 | @@ -34,6 +34,8 @@ IF(DEFINE_WIN) | ||
26 | add_definitions(-D__WIN__) | ||
27 | ENDIF(DEFINE_WIN) | ||
28 | |||
29 | +add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64) | ||
30 | + | ||
31 | include_directories("${CMAKE_SOURCE_DIR}/src") | ||
32 | |||
33 | add_executable(fatcat "src/fatcat.cpp" ${ALL_SOURCES}) | ||
34 | diff --git a/src/core/FatSystem.cpp b/src/core/FatSystem.cpp | ||
35 | index 79cda8c..1f52e82 100644 | ||
36 | --- a/src/core/FatSystem.cpp | ||
37 | +++ b/src/core/FatSystem.cpp | ||
38 | @@ -90,7 +90,7 @@ int FatSystem::readData(unsigned long long address, char *buffer, int size) | ||
39 | cerr << "! Trying to read outside the disk" << endl; | ||
40 | } | ||
41 | |||
42 | - lseek64(fd, globalOffset+address, SEEK_SET); | ||
43 | + lseek(fd, globalOffset+address, SEEK_SET); | ||
44 | |||
45 | int n; | ||
46 | int pos = 0; | ||
47 | @@ -112,7 +112,7 @@ int FatSystem::writeData(unsigned long long address, const char *buffer, int siz | ||
48 | throw string("Trying to write data while write mode is disabled"); | ||
49 | } | ||
50 | |||
51 | - lseek64(fd, globalOffset+address, SEEK_SET); | ||
52 | + lseek(fd, globalOffset+address, SEEK_SET); | ||
53 | |||
54 | int n; | ||
55 | int pos = 0; | ||
56 | diff --git a/src/core/FatSystem.h b/src/core/FatSystem.h | ||
57 | index cd3c914..f9f2ca3 100644 | ||
58 | --- a/src/core/FatSystem.h | ||
59 | +++ b/src/core/FatSystem.h | ||
60 | @@ -11,11 +11,9 @@ | ||
61 | |||
62 | #ifdef __APPLE__ | ||
63 | #define O_LARGEFILE 0 | ||
64 | -#define lseek64 lseek | ||
65 | #endif | ||
66 | #ifdef __WIN__ | ||
67 | #define O_LARGEFILE 0 | ||
68 | -#define lseek64 lseek | ||
69 | #endif | ||
70 | using namespace std; | ||
71 | |||
diff --git a/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb b/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb index e344eda154..982a52d62f 100644 --- a/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb +++ b/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb | |||
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=57fbbfebd0dd1d6ff21b8cecb552a03f" | |||
9 | 9 | ||
10 | SRC_URI = "git://github.com/Gregwar/fatcat.git;branch=master;protocol=https \ | 10 | SRC_URI = "git://github.com/Gregwar/fatcat.git;branch=master;protocol=https \ |
11 | file://0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch \ | 11 | file://0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch \ |
12 | file://0002-Enable-64bit-off_t.patch \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | SRCREV = "99cb99fc86eb1601ac7ae27f5bba23add04d2543" | 15 | SRCREV = "99cb99fc86eb1601ac7ae27f5bba23add04d2543" |