linux-atm: Fix compile warning
[openwrt/staging/wigyori.git] / package / network / utils / linux-atm / patches / 400-portability_fixes.patch
1 --- a/src/ilmid/io.c
2 +++ b/src/ilmid/io.c
3 @@ -48,6 +48,14 @@
4 be manually configured (after ilmid has
5 registered the "official" address) - HACK */
6
7 +#ifndef SUN_LEN
8 +# include <string.h> /* For prototype of `strlen'. */
9 +
10 +/* Evaluate to actual length of the `sockaddr_un' structure. */
11 +# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
12 + + strlen ((ptr)->sun_path))
13 +#endif
14 +
15 extern SysGroup *remsys;
16 extern State ilmi_state;
17 static short atm_itf = -1; /* bad value */
18 --- a/src/mpoad/io.c
19 +++ b/src/mpoad/io.c
20 @@ -10,14 +10,7 @@
21 #include <errno.h>
22 #include <sys/ioctl.h>
23 #include <sys/param.h> /* for OPEN_MAX */
24 -#if __GLIBC__ >= 2
25 #include <sys/poll.h>
26 -#else /* ugly hack to make it compile on RH 4.2 - WA */
27 -#include <syscall.h>
28 -#include <linux/poll.h>
29 -#define SYS_poll 168
30 -_syscall3(int,poll,struct pollfd *,ufds,unsigned int,nfds,int,timeout);
31 -#endif
32 #include <atm.h>
33 #include <linux/types.h>
34 #include <linux/atmioc.h>
35 --- a/src/sigd/atmsigd.c
36 +++ b/src/sigd/atmsigd.c
37 @@ -283,12 +283,11 @@ static void setup_signals(void)
38 /* ------------------------------- main ... ------------------------------- */
39
40
41 -static void trace_on_exit(int status,void *dummy)
42 +static void trace_on_exit(void)
43 {
44 char path[PATH_MAX+1];
45 FILE *file;
46
47 - if (!status) return;
48 if (!dump_dir) file = stderr;
49 else {
50 sprintf(path,"atmsigd.%d.trace.exit",getpid());
51 @@ -517,7 +516,7 @@ int main(int argc,char **argv)
52 exit(0);
53 }
54 }
55 - (void) on_exit(trace_on_exit,NULL);
56 + (void) atexit(trace_on_exit);
57 poll_loop();
58 close_all();
59 for (sig = entities; sig; sig = sig->next) stop_saal(&sig->saal);
60 --- a/src/test/align.c
61 +++ b/src/test/align.c
62 @@ -24,7 +24,7 @@
63 #include <signal.h>
64 #include <sys/types.h>
65 #include <sys/socket.h>
66 -#include <sys/errno.h>
67 +#include <errno.h>
68 #include <atm.h>
69
70