1 From: Felipe Sateler <fsateler@gmail.com>
2 Date: Thu, 15 Apr 2010 15:00:23 -0400
3 Subject: [PATCH] Drop cases for glibc < 2.4
5 Some functions definitions were dependant on the glibc version. Since
6 2.7 is in stable, drop everything for < 2.4. BK 20141220 edited.
8 installwatch/installwatch.c | 31 -------------------------------
9 1 files changed, 0 insertions(+), 31 deletions(-)
11 diff --git installwatch/installwatch.c installwatch/installwatch.c
12 index d34850d..857b9aa 100644
13 --- installwatch/installwatch.c
14 +++ installwatch/installwatch.c
15 @@ -88,11 +88,7 @@ static int (*true_xmknod)(int ver,const char *, mode_t, dev_t *);
16 static int (*true_open)(const char *, int, ...);
17 static DIR *(*true_opendir)(const char *);
18 static struct dirent *(*true_readdir)(DIR *dir);
19 -#if (GLIBC_MINOR <= 4)
20 -static int (*true_readlink)(const char*,char *,size_t);
22 static ssize_t (*true_readlink)(const char*,char *,size_t);
24 static char *(*true_realpath)(const char *,char *);
25 static int (*true_rename)(const char *, const char *);
26 static int (*true_rmdir)(const char *);
27 @@ -111,8 +107,6 @@ static int (*true_setxattr)(const char *,const char *,const void *,
29 static int (*true_removexattr)(const char *,const char *);
31 -#if(GLIBC_MINOR >= 1)
33 static int (*true_creat64)(const char *, __mode_t);
34 static FILE *(*true_fopen64)(const char *,const char *);
35 static int (*true_ftruncate64)(int, __off64_t);
36 @@ -125,9 +119,7 @@ static int (*true_xstat64)(int,const char *, struct stat64 *);
37 static int (*true_lxstat64)(int,const char *, struct stat64 *);
38 static int (*true_truncate64)(const char *, __off64_t);
42 -#if (GLIBC_MINOR >= 4)
43 static int (*true_openat)(int, const char *, int, ...);
44 static int (*true_fchmodat)(int, const char *, mode_t, int);
45 static int (*true_fchownat)(int, const char *, uid_t, gid_t, int);
46 @@ -140,7 +132,6 @@ static int (*true_xmknodat)(int, int, const char *, mode_t, dev_t *);
47 static int (*true_renameat)(int, const char *, int, const char *);
48 static int (*true_symlinkat)(const char *, int, const char *);
49 static int (*true_unlinkat)(int, const char *, int);
52 #if defined __GNUC__ && __GNUC__>=2
54 @@ -160,7 +151,6 @@ static inline int true_lstat(const char *pathname,struct stat *info) {
55 return true_lxstat(_STAT_VER,pathname,info);
58 -#if (GLIBC_MINOR >= 4)
59 static inline int true_fstatat(int dirfd, const char *pathname, struct stat *info, int flags) {
60 return true_fxstatat(_STAT_VER, dirfd, pathname, info, flags);
62 @@ -173,7 +163,6 @@ static inline int true_mknodat(int dirfd, const char *pathname,mode_t mode,dev_t
63 return true_xmknodat(_MKNOD_VER, dirfd, pathname, mode, &dev);
68 /* A few defines to fix things a little */
70 @@ -267,10 +256,8 @@ int parse_suffix(char *,char *,const char *);
73 static int __instw_printdirent(struct dirent*);
74 -#if(GLIBC_MINOR >= 1)
75 static int __instw_printdirent64(struct dirent64*);
80 static int instw_print(instw_t *);
81 @@ -285,9 +272,7 @@ static int instw_delete(instw_t *);
82 static int instw_setmetatransl(instw_t *);
84 static int instw_setpath(instw_t *,const char *);
85 -#if (GLIBC_MINOR >= 4)
86 static int instw_setpathrel(instw_t *, int, const char *);
88 static int instw_getstatus(instw_t *,int *);
89 static int instw_apply(instw_t *);
90 static int instw_filldirls(instw_t *);
91 @@ -374,7 +359,6 @@ static void initialize(void) {
95 -#if(GLIBC_MINOR >= 1)
96 true_creat64 = dlsym(libc_handle, "creat64");
97 true_fopen64 = dlsym(libc_handle, "fopen64");
98 true_ftruncate64 = dlsym(libc_handle, "ftruncate64");
99 @@ -385,9 +369,7 @@ static void initialize(void) {
100 true_lxstat64 = dlsym(libc_handle, "__lxstat64");
101 true_truncate64 = dlsym(libc_handle, "truncate64");
102 true_removexattr = dlsym(libc_handle, "removexattr");
105 -#if (GLIBC_MINOR >= 4)
107 true_openat = dlsym(libc_handle, "openat");
108 true_fchmodat = dlsym(libc_handle, "fchmodat");
109 @@ -402,7 +384,6 @@ static void initialize(void) {
110 true_symlinkat = dlsym(libc_handle, "symlinkat");
111 true_unlinkat = dlsym(libc_handle, "unlinkat");
115 if(instw_init()) exit(-1);
117 @@ -1669,7 +1650,6 @@ static int instw_setpath(instw_t *instw,const char *path) {
118 * returns = / 0 ok. path set
119 * -1 failed. cf errno /
121 -#if (GLIBC_MINOR >= 4)
122 static int instw_setpathrel(instw_t *instw, int dirfd, const char *relpath) {
124 /* This constant should be large enough to make a string that holds
125 @@ -1709,7 +1689,6 @@ out:
132 * procedure = / rc:=instw_getstatus(instw,status) /
133 @@ -2938,13 +2917,8 @@ struct dirent *readdir(DIR *dir) {
137 -#if (GLIBC_MINOR <= 4)
138 -int readlink(const char *path,char *buf,size_t bufsiz) {
141 ssize_t readlink(const char *path,char *buf,size_t bufsiz) {
147 @@ -3494,7 +3468,6 @@ int removexattr (const char *pathname, const char *name)
151 -#if(GLIBC_MINOR >= 1)
153 int creat64(const char *pathname, __mode_t mode) {
154 /* Is it a system call? */
155 @@ -3834,7 +3807,6 @@ int truncate64(const char *path, __off64_t length) {
159 -#endif /* GLIBC_MINOR >= 1 */
162 /***********************************************
163 @@ -3854,7 +3826,6 @@ int truncate64(const char *path, __off64_t length) {
164 * Thanks to Gilbert Ashley for his work on this!
167 -#if (GLIBC_MINOR >= 4)
169 int openat (int dirfd, const char *path, int flags, ...) {
171 @@ -4519,5 +4490,3 @@ int unlinkat (int dirfd, const char *path, int flags) {
176 -#endif /* GLIBC_MINOR >= 4 */