From 75c9099d0f6827bfe1cf811bb9a217414fec2163 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 5 Jan 2024 17:08:32 +0100 Subject: [PATCH] Additional C compatibility fixes (#2152303) --- libdb-1.85-c99.patch | 16 ++++++++++++++++ libdb-configure-c99.patch | 17 ++++++++++------- libdb.spec | 5 ++++- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/libdb-1.85-c99.patch b/libdb-1.85-c99.patch index 1d187a5..54c4f3d 100644 --- a/libdb-1.85-c99.patch +++ b/libdb-1.85-c99.patch @@ -4,6 +4,9 @@ This avoids an implicit function declaration of vsprintf. snprintf is only called from db.1.85/btree/bt_open.c, and the length checking in the glibc implementation seems harmless there. +Furthermore, NULL is not a valid integer constant, so use 0 directly +(the __bt_first function in bt_seq.c returns int). + diff -ur db-5.3.28.orig/db.1.85/PORT/linux/Makefile db-5.3.28/db.1.85/PORT/linux/Makefile --- db-5.3.28.orig/db.1.85/PORT/linux/Makefile 2022-12-10 12:29:48.599322424 +0100 +++ db-5.3.28/db.1.85/PORT/linux/Makefile 2022-12-10 12:35:08.415288426 +0100 @@ -16,3 +19,16 @@ diff -ur db-5.3.28.orig/db.1.85/PORT/linux/Makefile db-5.3.28/db.1.85/PORT/linux ${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} rm -f $@ +only in patch2: +unchanged: +--- db-5.3.28.orig/db.1.85/btree/bt_seq.c 1994-07-26 18:57:24.000000000 +0200 ++++ db-5.3.28/db.1.85/btree/bt_seq.c 2024-01-05 15:53:31.859178929 +0100 +@@ -358,7 +358,7 @@ + * page) and return it. + */ + if ((ep = __bt_search(t, key, exactp)) == NULL) +- return (NULL); ++ return 0; + if (*exactp) { + if (F_ISSET(t, B_NODUPS)) { + *erval = *ep; diff --git a/libdb-configure-c99.patch b/libdb-configure-c99.patch index ae07b8f..ff9c79d 100644 --- a/libdb-configure-c99.patch +++ b/libdb-configure-c99.patch @@ -23,15 +23,18 @@ diff -ur db-5.3.28.orig/dist/aclocal/clock.m4 db-5.3.28/dist/aclocal/clock.m4 struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); ], db_cv_clock_monotonic=yes, db_cv_clock_monotonic=no)) -diff -ur db-5.3.28.orig/dist/aclocal/mmap.m4 db-5.3.28/dist/aclocal/mmap.m4 ---- db-5.3.28.orig/dist/aclocal/mmap.m4 2013-09-09 17:35:02.000000000 +0200 -+++ db-5.3.28/dist/aclocal/mmap.m4 2022-12-10 12:38:04.520617781 +0100 -@@ -45,10 +45,10 @@ - int catch_sig(sig) - int sig; +diff -u db-5.3.28/dist/aclocal/mmap.m4 db-5.3.28/dist/aclocal/mmap.m4 +--- db-5.3.28/dist/aclocal/mmap.m4 2024-01-05 16:07:07.340002918 +0100 ++++ db-5.3.28/dist/aclocal/mmap.m4 2024-01-05 16:45:12.128407358 +0100 +@@ -42,13 +42,11 @@ + #define MAP_FAILED (-1) + #endif + +- int catch_sig(sig) +- int sig; ++ void catch_sig(int sig) { - exit(1); -+ return 1; } - main() { diff --git a/libdb.spec b/libdb.spec index 52d3509..4a49fb3 100644 --- a/libdb.spec +++ b/libdb.spec @@ -14,7 +14,7 @@ Summary: The Berkeley DB database library for C Name: libdb Version: 5.3.28 -Release: 58%{?dist} +Release: 59%{?dist} Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz # For mt19937db.c @@ -486,6 +486,9 @@ install -m 0755 db_converter-%{_converter_version}/db_converter %{buildroot}/%{_ %endif %changelog +* Fri Jan 05 2024 Florian Weimer - 5.3.28-59 +- Additional C compatibility fixes (#2152303) + * Fri Sep 08 2023 Yaakov Selkowitz - 5.3.28-58 - Re-enable subpackages in RHEL builds