Files
gentoo/net-misc/rsync-bpc/files/rsync-bpc-3.1.3.0-fix-gettimeofday-error.patch
Dennis Eisele 8f0ea097eb net-misc/rsync-bpc: fix several modernc issues and warnings
This commit fixes implicit function declaration errors and other modernc
issues.
It also fixes several warnings about deprecated or wrongly used
headers.
Configuration options added by these fixes are also
adopted by adding some new use flags.

Closes: https://bugs.gentoo.org/900312
Closes: https://bugs.gentoo.org/944357
Closes: https://bugs.gentoo.org/854612

Signed-off-by: Dennis Eisele <kernlpanic@dennis-eisele.de>
Part-of: https://github.com/gentoo/gentoo/pull/42908
Closes: https://github.com/gentoo/gentoo/pull/42908
Signed-off-by: Sam James <sam@gentoo.org>
2025-07-16 04:16:28 +01:00

31 lines
1.3 KiB
Diff

From 7ea8fe71a2e2f0ed4013cb9dcdea046c846e3c14 Mon Sep 17 00:00:00 2001
From: Andreas Hasenack <andreas.hasenack@canonical.com>
Date: Wed, 17 Apr 2024 20:49:13 -0300
Subject: [PATCH] configure.ac: fix gettimeofday() args detection
The configure check for gettimeofday() was failing not because of the
arguments, but because exit() was undeclared.
conftest.c: In function 'main':
conftest.c:177:20: error: implicit declaration of function 'exit' [-Werror=implicit-function-declaration]
177 | struct timeval tv; exit(gettimeofday(&tv, NULL));
| ^~~~
conftest.c:174:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index cc685cb..b240cbe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1148,6 +1148,7 @@ AC_CACHE_CHECK([if gettimeofday takes tz argument],rsync_cv_HAVE_GETTIMEOFDAY_TZ
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#include <stdlib.h>
#endif]], [[struct timeval tv; return gettimeofday(&tv, NULL);]])],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=no])])
if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" != x"no"; then
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [Define to 1 if gettimeofday() takes a time-zone arg])