upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / xrootd4 / trunk / stat_ver.patch
blobb53bf20433d4f63a51d664281874c5c24c5aac50
1 From 5298c732c394d7ac3c24abc7d01a4631f573e692 Mon Sep 17 00:00:00 2001
2 From: Michal Simon <michal.simon@cern.ch>
3 Date: Mon, 2 Nov 2020 09:47:25 +0100
4 Subject: [PATCH] [XrdPosix] Fix _STAT_VER problem on Fedora rawhide.
6 ---
7 src/XrdPosix/XrdPosix.cc | 10 +++++++---
8 src/XrdPosix/XrdPosixLinkage.hh | 10 +++++-----
9 src/XrdPosix/XrdPosixPreload32.cc | 4 ++--
10 3 files changed, 14 insertions(+), 10 deletions(-)
12 diff --git a/src/XrdPosix/XrdPosix.cc b/src/XrdPosix/XrdPosix.cc
13 index 290f9fe7314..f582eb4617c 100644
14 --- a/src/XrdPosix/XrdPosix.cc
15 +++ b/src/XrdPosix/XrdPosix.cc
16 @@ -375,7 +375,7 @@ int XrdPosix_Fstat(int fildes, struct stat *buf)
18 return (Xroot.myFD(fildes)
19 ? Xroot.Fstat(fildes, buf)
20 -#ifdef __linux__
21 +#if defined(__linux__) and defined(_STAT_VER)
22 : Xunix.Fstat64(_STAT_VER, fildes, (struct stat64 *)buf));
23 #else
24 : Xunix.Fstat64( fildes, (struct stat64 *)buf));
25 @@ -387,7 +387,11 @@ int XrdPosix_FstatV(int ver, int fildes, struct stat *buf)
27 return (Xroot.myFD(fildes)
28 ? Xroot.Fstat(fildes, buf)
29 +#ifdef _STAT_VER
30 : Xunix.Fstat64(ver, fildes, (struct stat64 *)buf));
31 +#else
32 + : Xunix.Fstat64( fildes, (struct stat64 *)buf));
33 +#endif
35 #endif
37 @@ -559,7 +563,7 @@ int XrdPosix_Lstat(const char *path, struct stat *buf)
38 // Return the results of an open of a Unix file
40 return (!(myPath = XrootPath.URL(path, buff, sizeof(buff)))
41 -#ifdef __linux__
42 +#if defined(__linux__) and defined(_STAT_VER)
43 ? Xunix.Lstat64(_STAT_VER, path, (struct stat64 *)buf)
44 #else
45 ? Xunix.Lstat64( path, (struct stat64 *)buf)
46 @@ -887,7 +891,7 @@ int XrdPosix_Stat(const char *path, struct stat *buf)
47 // Return the results of an open of a Unix file
49 return (!(myPath = XrootPath.URL(path, buff, sizeof(buff)))
50 -#ifdef __linux__
51 +#if defined(__linux__) and defined(_STAT_VER)
52 ? Xunix.Stat64(_STAT_VER, path, (struct stat64 *)buf)
53 #else
54 ? Xunix.Stat64( path, (struct stat64 *)buf)
55 diff --git a/src/XrdPosix/XrdPosixLinkage.hh b/src/XrdPosix/XrdPosixLinkage.hh
56 index f298d098250..241222fa79c 100644
57 --- a/src/XrdPosix/XrdPosixLinkage.hh
58 +++ b/src/XrdPosix/XrdPosixLinkage.hh
59 @@ -116,7 +116,7 @@
60 #define Retv_Fseeko64 int
61 #define Args_Fseeko64 FILE *, off64_t, int
63 -#ifdef __linux__
64 +#if defined(__linux__) and defined(_STAT_VER)
65 #define Symb_Fstat UNIX_PFX "__fxstat"
66 #define Retv_Fstat int
67 #define Args_Fstat int, int, struct stat *
68 @@ -126,7 +126,7 @@
69 #define Args_Fstat int, struct stat *
70 #endif
72 -#ifdef __linux__
73 +#if defined(__linux__) and defined(_STAT_VER)
74 #define Symb_Fstat64 UNIX_PFX "__fxstat64"
75 #define Retv_Fstat64 int
76 #define Args_Fstat64 int, int, struct stat64 *
77 @@ -184,7 +184,7 @@
78 #define Retv_Lseek64 off64_t
79 #define Args_Lseek64 int, off64_t, int
81 -#ifdef __linux__
82 +#if defined(__linux__) and defined(_STAT_VER)
83 #define Symb_Lstat UNIX_PFX "__lxstat"
84 #define Retv_Lstat int
85 #define Args_Lstat int, const char *, struct stat *
86 @@ -194,7 +194,7 @@
87 #define Args_Lstat const char *, struct stat *
88 #endif
90 -#ifdef __linux__
91 +#if defined(__linux__) and defined(_STAT_VER)
92 #define Symb_Lstat64 UNIX_PFX "__lxstat64"
93 #define Retv_Lstat64 int
94 #define Args_Lstat64 int, const char *, struct stat64 *
95 @@ -290,7 +290,7 @@
96 #define Args_Stat const char *, struct stat *
97 #endif
99 -#ifdef __linux__
100 +#if defined(__linux__) and defined(_STAT_VER)
101 #define Symb_Stat64 UNIX_PFX "__xstat64"
102 #define Retv_Stat64 int
103 #define Args_Stat64 int, const char *, struct stat64 *
104 diff --git a/src/XrdPosix/XrdPosixPreload32.cc b/src/XrdPosix/XrdPosixPreload32.cc
105 index 20364aaad54..fa2343afcef 100644
106 --- a/src/XrdPosix/XrdPosixPreload32.cc
107 +++ b/src/XrdPosix/XrdPosixPreload32.cc
108 @@ -230,7 +230,7 @@ int fstat( int fildes, struct stat *buf)
110 static int Init = Xunix.Init(&Init);
112 -#ifdef __linux__
113 +#if defined(__linux__) and defined(_STAT_VER)
114 if (!XrdPosixXrootd::myFD(fildes)) return Xunix.Fstat(ver, fildes, buf);
115 #else
116 if (!XrdPosixXrootd::myFD(fildes)) return Xunix.Fstat( fildes, buf);
117 @@ -315,7 +315,7 @@ int lstat( const char *path, struct stat *buf)
118 static int Init = Xunix.Init(&Init);
120 if (!XrdPosix_isMyPath(path))
121 -#ifdef __linux__
122 +#if defined(__linux__) and defined(_STAT_VER)
123 return Xunix.Lstat(ver, path, buf);
124 #else
125 return Xunix.Lstat( path, buf);