1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
Description: make it compile with gcc15
Index: rlpr/lib/error.c
===================================================================
--- rlpr.orig/lib/error.c 2025-09-08 23:48:47.951423166 +0200
+++ rlpr/lib/error.c 2025-09-15 23:16:30.700866082 +0200
@@ -26,6 +26,7 @@
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
# if __STDC__
+# include <stdlib.h>
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
# else
@@ -43,7 +44,7 @@
# include <string.h>
#else
#include <string.h>
-void exit ();
+void exit (int);
#endif
#ifndef _
@@ -79,7 +80,7 @@
# if HAVE_STRERROR
# ifndef strerror /* On some systems, strerror is a macro */
-char *strerror ();
+char *strerror (int);
# endif
# else
static char *
Index: rlpr/lib/xstrtol.h
===================================================================
--- rlpr.orig/lib/xstrtol.h 2025-09-08 23:46:46.951309147 +0200
+++ rlpr/lib/xstrtol.h 2025-09-09 00:04:15.776160938 +0200
@@ -8,6 +8,7 @@
# define __ZLONG_MAX ULONG_MAX
# else
# define __xstrtol xstrtol
+
# define __strtol strtol
# define __unsigned /* empty */
# define __ZLONG_MAX LONG_MAX
Index: rlpr/lib/xmalloc.c
===================================================================
--- rlpr.orig/lib/xmalloc.c 2025-09-08 23:46:46.951309147 +0200
+++ rlpr/lib/xmalloc.c 2025-09-15 22:57:30.543959251 +0200
@@ -27,14 +27,15 @@
#include <sys/types.h>
-#if STDC_HEADERS
+// we do have stdlib.h
+//#if STDC_HEADERS
# include <stdlib.h>
-#else
-VOID *calloc ();
-VOID *malloc ();
-VOID *realloc ();
-void free ();
-#endif
+//#else
+//VOID *calloc ();
+//VOID *malloc ();
+//VOID *realloc ();
+//void free ();
+//#endif
#if ENABLE_NLS
# include <libintl.h>
@@ -70,8 +71,7 @@
#endif
static VOID *
-fixup_null_alloc (n)
- size_t n;
+fixup_null_alloc (size_t n)
{
VOID *p;
@@ -86,8 +86,7 @@
/* Allocate N bytes of memory dynamically, with error checking. */
VOID *
-xmalloc (n)
- size_t n;
+xmalloc (size_t n)
{
VOID *p;
@@ -100,8 +99,7 @@
/* Allocate memory for N elements of S bytes, with error checking. */
VOID *
-xcalloc (n, s)
- size_t n, s;
+xcalloc (size_t n, size_t s)
{
VOID *p;
@@ -116,9 +114,7 @@
If P is NULL, run xmalloc. */
VOID *
-xrealloc (p, n)
- VOID *p;
- size_t n;
+xrealloc (VOID *p, size_t n)
{
if (p == 0)
return xmalloc (n);
Index: rlpr/lib/xstrdup.c
===================================================================
--- rlpr.orig/lib/xstrdup.c 2025-09-08 23:46:46.951309147 +0200
+++ rlpr/lib/xstrdup.c 2025-09-15 22:58:16.639995095 +0200
@@ -35,8 +35,7 @@
/* Return a newly allocated copy of STRING. */
char *
-xstrdup (string)
- char *string;
+xstrdup (char *string)
{
return strcpy (xmalloc (strlen (string) + 1), string);
}
Index: rlpr/lib/xstrtol.c
===================================================================
--- rlpr.orig/lib/xstrtol.c 2025-09-08 23:46:46.951309147 +0200
+++ rlpr/lib/xstrtol.c 2025-09-15 23:11:05.956602811 +0200
@@ -65,17 +65,17 @@
} \
while (0)
-__unsigned long int __strtol ();
+__unsigned long int __strtol (const char *, char **, int);
/* FIXME: comment. */
strtol_error
-__xstrtol (s, ptr, base, val, valid_suffixes)
- const char *s;
- char **ptr;
- int base;
- __unsigned long int *val;
- const char *valid_suffixes;
+__xstrtol (const char *s, char **ptr, int base, __unsigned long int *val, const char *valid_suffixes)
+// const char *s;
+// char **ptr;
+// int base;
+// __unsigned long int *val;
+// const char *valid_suffixes;
{
char *t_ptr;
char **p;
Index: rlpr/src/rlprd.c
===================================================================
--- rlpr.orig/src/rlprd.c 2025-09-08 23:48:47.935423151 +0200
+++ rlpr/src/rlprd.c 2025-09-15 23:24:18.149251705 +0200
@@ -56,8 +56,10 @@
static int process_client(int, struct sockaddr_in *);
static int register_sigchld(void);
static int daemonize(void);
-static RETSIGTYPE catch_sigchld(int);
-static RETSIGTYPE graceful_shutdown(int);
+//XXX static RETSIGTYPE catch_sigchld(int);
+//XXX static RETSIGTYPE graceful_shutdown(int);
+static void catch_sigchld(int);
+static void graceful_shutdown(int);
int
main(int argc, char *argv[])
@@ -248,7 +250,8 @@
}
/* ARGSUSED */
-static RETSIGTYPE
+//XXX static RETSIGTYPE
+static void
catch_sigchld(int unused)
{
while (waitpid(-1, 0, WNOHANG) > 0)
@@ -256,7 +259,8 @@
}
/* ARGSUSED */
-static RETSIGTYPE
+//XXX static RETSIGTYPE
+static void
graceful_shutdown(int unused)
{
struct component *comp;
|