Openwrt/package/network/utils/linux-atm/patches/400-portability_fixes.patch
Hauke Mehrtens 806354ab53 linux-atm: Fix compile warning
The function trace_on_exit() is given to atexit() as a parameter, but
atexit() only takes a function pointer to a function with a void
parameter.

This problem was introduced when the on_exit() function was incompletely
replaced by atexit().

Fixes: ba6c8bd614 ("linux-atm: add portability fixes")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-02-24 23:25:28 +01:00

71 lines
1.9 KiB
Diff

--- a/src/ilmid/io.c
+++ b/src/ilmid/io.c
@@ -48,6 +48,14 @@
be manually configured (after ilmid has
registered the "official" address) - HACK */
+#ifndef SUN_LEN
+# include <string.h> /* For prototype of `strlen'. */
+
+/* Evaluate to actual length of the `sockaddr_un' structure. */
+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ + strlen ((ptr)->sun_path))
+#endif
+
extern SysGroup *remsys;
extern State ilmi_state;
static short atm_itf = -1; /* bad value */
--- a/src/mpoad/io.c
+++ b/src/mpoad/io.c
@@ -10,14 +10,7 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/param.h> /* for OPEN_MAX */
-#if __GLIBC__ >= 2
#include <sys/poll.h>
-#else /* ugly hack to make it compile on RH 4.2 - WA */
-#include <syscall.h>
-#include <linux/poll.h>
-#define SYS_poll 168
-_syscall3(int,poll,struct pollfd *,ufds,unsigned int,nfds,int,timeout);
-#endif
#include <atm.h>
#include <linux/types.h>
#include <linux/atmioc.h>
--- a/src/sigd/atmsigd.c
+++ b/src/sigd/atmsigd.c
@@ -283,12 +283,11 @@ static void setup_signals(void)
/* ------------------------------- main ... ------------------------------- */
-static void trace_on_exit(int status,void *dummy)
+static void trace_on_exit(void)
{
char path[PATH_MAX+1];
FILE *file;
- if (!status) return;
if (!dump_dir) file = stderr;
else {
sprintf(path,"atmsigd.%d.trace.exit",getpid());
@@ -517,7 +516,7 @@ int main(int argc,char **argv)
exit(0);
}
}
- (void) on_exit(trace_on_exit,NULL);
+ (void) atexit(trace_on_exit);
poll_loop();
close_all();
for (sig = entities; sig; sig = sig->next) stop_saal(&sig->saal);
--- a/src/test/align.c
+++ b/src/test/align.c
@@ -24,7 +24,7 @@
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <atm.h>