termux-packages/packages/libelf/debuginfod.cxx.patch

39 lines
1.1 KiB
Diff
Raw Normal View History

--- elfutils-0.185/debuginfod/debuginfod.cxx 2021-05-22 23:55:24.000000000 +0530
+++ elfutils-0.185-patch/debuginfod/debuginfod.cxx 2021-08-28 23:44:30.087999769 +0530
@@ -58,7 +58,6 @@
#include <fcntl.h>
#include <netdb.h>
-
/* If fts.h is included before config.h, its indirect inclusions may not
give us the right LFS aliases of these functions, so map them manually. */
#ifdef BAD_FTS
@@ -93,6 +92,7 @@
#include <libdwelf.h>
#include <microhttpd.h>
+#include <netinet/in.h>
#if MHD_VERSION >= 0x00097002
// libmicrohttpd 0.9.71 broke API
@@ -116,6 +116,19 @@
#define tid() pthread_self()
#endif
+static int futimes(int fd, const struct timeval tv[2]) {
+ if (tv == NULL)
+ return syscall(__NR_utimensat, fd, NULL, NULL, 0);
+ if (tv[0].tv_usec < 0 || tv[0].tv_usec >= 1000000 || tv[1].tv_usec < 0 ||
+ tv[1].tv_usec >= 1000000) {
+ return -1;
+ }
+ // Convert timeval to timespec.
+ struct timespec ts[2];
+ TIMEVAL_TO_TIMESPEC(tv, ts);
+
+ return syscall(__NR_utimensat, fd, NULL, ts, 0);
+}
inline bool
string_endswith(const string& haystack, const string& needle)