Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Version 0.2.1

- use "m" mode flag of fopen only when compiling with glibc 2.3 or higher.

- LT_VERSION 2:1:1

- no change in public interface

# Version 0.2.0

- delete debug output automatically printed when DEBUG is defiend in
Expand Down
7 changes: 5 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- Autoconf -*-
AC_INIT(libreadtags, 0.2.0)
AC_INIT(libreadtags, 0.2.1)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([readtags.c])

Expand Down Expand Up @@ -29,7 +29,10 @@ AC_PROG_LIBTOOL
# introduced TagErrnoFileMayTooBig.
# introduced tagsFindPseudoTag.
#
AC_SUBST(LT_VERSION, [2:0:1])
# 2:1:1
# no change in public interface.
#
AC_SUBST(LT_VERSION, [2:1:1])

AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov],
Expand Down
6 changes: 4 additions & 2 deletions readtags.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,10 @@ static tagFile *initialize (const char *const filePath, tagFileInfo *const info)
if (result->fields.list == NULL)
goto mem_error;

#define GLIBC_FOPEN_MODE_USE_MMAP "m"
result->fp = fopen (filePath, "rb" GLIBC_FOPEN_MODE_USE_MMAP);
#if defined(__GLIBC__) && (__GLIBC__ >= 2) \
&& defined(__GLIBC_MINOR__) && (__GLIBC_MINOR__ >= 3)
result->fp = fopen (filePath, "rbm");
#endif
if (result->fp == NULL)
{
errno = 0;
Expand Down