]> sourceware.org Git - debugedit.git/commitdiff
sepdebugcrcfix: Do not use LFS64 functions
authorViolet Purcell <vimproved@inventati.org>
Tue, 11 Jul 2023 19:52:57 +0000 (15:52 -0400)
committerMark Wielaard <mark@klomp.org>
Thu, 13 Jul 2023 10:24:21 +0000 (12:24 +0200)
The LFS64 function calls have been gated behind the _LARGEFILE64_SOURCE
macro in musl 1.2.4, and will be removed altogether in musl 1.2.5. Since
configure.ac has the AC_SYS_LARGEFILE macro, which ensures that all
functions on 32-bit glibc systems will be 64-bit, just replace the
interfaces with their normal variants.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
tools/sepdebugcrcfix.c

index da50e6c979c7f36219d439ca6dc0b2b8710ccc37..7464f6a80f13f1ae23c77bb08487e51bba987dad 100644 (file)
@@ -139,7 +139,7 @@ crc32 (const char *fname, const char *base_fname, uint32_t *crcp)
       error (0, errno, _("cannot open \"%s\""), debugname);
       return false;
     }
-  off64_t size = lseek64 (fd, 0, SEEK_END);
+  off_t size = lseek (fd, 0, SEEK_END);
   if (size == -1)
     {
       error (0, errno, _("cannot get size of \"%s\""), debugname);
@@ -284,7 +284,7 @@ process (Elf *elf, int fd, const char *fname)
          return true;
        }
       updated_count++;
-      off64_t seekto = (shdr->sh_offset + data->d_off
+      off_t seekto = (shdr->sh_offset + data->d_off
                        + (crcp - (const uint8_t *) data->d_buf));
       uint32_t crc_targetendian = (ehdr->e_ident[EI_DATA] == ELFDATA2LSB
                                   ? htole32 (crc) : htobe32 (crc));
@@ -356,7 +356,7 @@ main (int argc, char **argv)
        error (0, errno, _("cannot chmod \"%s\" to make sure we can read and write"), fname);
 
       bool failed = false;
-      int fd = open64 (fname, O_RDWR);
+      int fd = open (fname, O_RDWR);
       if (fd == -1)
        {
          error (0, errno, _("cannot open \"%s\""), fname);
This page took 0.02629 seconds and 5 git commands to generate.