Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From be33cf1812b4c2a3ed85fb2532992bfb2b27b3be Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 15 Dec 2022 08:44:13 -0800 |
| 4 | Subject: [PATCH] posix-io.c: Use off_t instead of off64_t |
| 5 | |
| 6 | configure.ac checks for largefile support via AC_SYS_LARGEFILE already, |
| 7 | therefore use off_t and ino_t instead of 64bit variants. Musl e.g. does |
| 8 | not define them without _LARGEFILE64_SOURCE and error is not seen on |
| 9 | glibc because _GNU_SOURCE defines _LARGEFILE64_SOURCE |
| 10 | |
| 11 | Fixes errors like below on 32-bit musl systems |
| 12 | |
| 13 | ../../../../../../../../workspace/sources/gpgme/src/posix-io.c:77:3: error: unknown type name 'ino64_t'; did you mean 'int64_t'? |
| 14 | ino64_t d_ino; |
| 15 | ^~~~~~~ |
| 16 | int64_t |
| 17 | ^ |
| 18 | ../../../../../../../../workspace/sources/gpgme/src/posix-io.c:78:3: error: unknown type name 'off64_t'; did you mean 'off_t'? |
| 19 | off64_t d_off; |
| 20 | ^~~~~~~ |
| 21 | |
| 22 | Upstream-Status: Submitted [https://lists.gnupg.org/pipermail/gnupg-devel/2022-December/035222.html] |
| 23 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 24 | --- |
| 25 | src/posix-io.c | 4 ++-- |
| 26 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 27 | |
| 28 | diff --git a/src/posix-io.c b/src/posix-io.c |
| 29 | index 0d0a98b..286a626 100644 |
| 30 | --- a/src/posix-io.c |
| 31 | +++ b/src/posix-io.c |
| 32 | @@ -74,8 +74,8 @@ |
| 33 | * define it ourselves. */ |
| 34 | struct linux_dirent64 |
| 35 | { |
| 36 | - ino64_t d_ino; |
| 37 | - off64_t d_off; |
| 38 | + ino_t d_ino; |
| 39 | + off_t d_off; |
| 40 | unsigned short d_reclen; |
| 41 | unsigned char d_type; |
| 42 | char d_name[]; |