diff options
| author | Josh Stone <[email protected]> | 2015-10-09 10:10:37 -0700 |
|---|---|---|
| committer | Josh Stone <[email protected]> | 2015-10-09 10:10:37 -0700 |
| commit | 3425454a10d307fae891fb667cf7969e945cde79 (patch) | |
| tree | ba30fbaff59ca353f4dad8759770600853fb00c1 /src/unstrip.c | |
| parent | f17d101232d6d40e192e61441aa02a12ee8cf9b8 (diff) | |
Trust AC_SYS_LARGEFILE to provide large file support
AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS in config.h if needed for
LFS, and this automatically maps things like open to open64. But quite
a few places used explicit 64-bit names, which won't work on platforms
like FreeBSD where off_t is always 64-bit and there are no foo64 names.
It's better to just trust that AC_SYS_LARGEFILE is doing it correctly.
But we can verify this too, as some file could easily forget to include
config.h. The new tests/run-lfs-symbols.sh checks all build targets
against lfs-symbols (taken from lintian) to make sure everything was
implicitly mapped to 64-bit variants when _FILE_OFFSET_BITS is set.
Signed-off-by: Josh Stone <[email protected]>
Diffstat (limited to 'src/unstrip.c')
| -rw-r--r-- | src/unstrip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/unstrip.c b/src/unstrip.c index b725987c..bc8ed503 100644 --- a/src/unstrip.c +++ b/src/unstrip.c @@ -176,9 +176,9 @@ parse_opt (int key, char *arg, struct argp_state *state) if (info->output_dir != NULL) { - struct stat64 st; + struct stat st; error_t fail = 0; - if (stat64 (info->output_dir, &st) < 0) + if (stat (info->output_dir, &st) < 0) fail = errno; else if (!S_ISDIR (st.st_mode)) fail = ENOTDIR; @@ -1988,7 +1988,7 @@ DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"), make_directories (output_file); /* Copy the unstripped file and then modify it. */ - int outfd = open64 (output_file, O_RDWR | O_CREAT, + int outfd = open (output_file, O_RDWR | O_CREAT, stripped_ehdr->e_type == ET_REL ? 0666 : 0777); if (outfd < 0) error (EXIT_FAILURE, errno, _("cannot open '%s'"), output_file); @@ -2018,7 +2018,7 @@ DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"), static int open_file (const char *file, bool writable) { - int fd = open64 (file, writable ? O_RDWR : O_RDONLY); + int fd = open (file, writable ? O_RDWR : O_RDONLY); if (fd < 0) error (EXIT_FAILURE, errno, _("cannot open '%s'"), file); return fd; |
