summaryrefslogtreecommitdiffstats
path: root/main/logrotate/qsort.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/logrotate/qsort.patch')
-rw-r--r--main/logrotate/qsort.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/main/logrotate/qsort.patch b/main/logrotate/qsort.patch
new file mode 100644
index 000000000..1e932be19
--- /dev/null
+++ b/main/logrotate/qsort.patch
@@ -0,0 +1,32 @@
+--- ./logrotate.c.orig
++++ ./logrotate.c
+@@ -117,11 +117,12 @@
+ return 1;
+ }
+
+-#if defined(HAVE_STRPTIME) && defined(HAVE_QSORT_R)
+-static int compGlobResult(const void *result1, const void *result2, void *data) {
++#if defined(HAVE_STRPTIME)
++static struct compData qsort_data;
++static int compGlobResult(const void *result1, const void *result2) {
+ struct tm time;
+ time_t t1, t2;
+- struct compData *d = (struct compData *) data;
++ struct compData *d = &qsort_data;
+ const char *r1 = *(const char **)(result1);
+ const char *r2 = *(const char **)(result2);
+
+@@ -139,10 +140,9 @@
+ }
+
+ static void sortGlobResult(glob_t *result, int prefix_len, const char *dformat) {
+- struct compData d;
+- d.prefix_len = prefix_len;
+- d.dformat = dformat;
+- qsort_r(result->gl_pathv, result->gl_pathc, sizeof(char *), compGlobResult, &d);
++ qsort_data.prefix_len = prefix_len;
++ qsort_data.dformat = dformat;
++ qsort(result->gl_pathv, result->gl_pathc, sizeof(char *), compGlobResult);
+ }
+ #else
+ static void sortGlobResult(glob_t *result, int prefix_len, const char *dformat) {