[package] unbreak mrd6, fix configuration files and init script installation (#5221)
[packages.git] / ipv6 / mrd6 / patches / 003-debian.patch
1 --- mrd6-0.9.6.orig/src/log.cpp
2 +++ mrd6-0.9.6/src/log.cpp
3 @@ -667,3 +667,12 @@
4         os.nprintf(32, "%p", val);
5  }
6  
7 +#ifdef __s390__
8 +const char *stream_type_format_parameter(size_t) {
9 +       return "u";
10 +}
11 +
12 +void stream_push_formated_type(base_stream &os, size_t val) {
13 +       os.nprintf(32, "%z", val);
14 +}
15 +#endif
16 --- mrd6-0.9.6.orig/src/mrd.cpp
17 +++ mrd6-0.9.6/src/mrd.cpp
18 @@ -44,6 +44,7 @@
19  #include <cstdarg>
20  #include <cstdlib>
21  #include <errno.h>
22 +#include <climits>
23  
24  #include <unistd.h>
25  #include <fcntl.h>
26 @@ -2338,7 +2339,8 @@
27  
28         out.xprintf("Uptime: %{duration}\n", time_duration((time(0) - m_startup) * 1000));
29         out.xprintf("Performed tasks: %u (spent %llu ms)\n", m_tasks_stat, m_tasks_time_spent);
30 -       out.xprintf("Registered sockets: %u reading, %u writing\n", m_read.size(), m_write.size());
31 +       out.xprintf("Registered sockets: %u reading, %u writing\n",
32 +               (uint32_t)m_read.size(), (uint32_t)m_write.size());
33         out.xprintf("MRIB prefix count: %u\n", mrib().registry_prefix_count());
34         out.xprintf("Interface count: %u\n", m_intflist.size());
35         out.xprintf("Group state count: %u\n", m_grplist.size());
36 --- mrd6-0.9.6.orig/src/bgp/bgp.cpp
37 +++ mrd6-0.9.6/src/bgp/bgp.cpp
38 @@ -35,6 +35,7 @@
39  #include <fcntl.h>
40  #include <errno.h>
41  #include <unistd.h>
42 +#include <limits.h>
43  
44  #include <map>
45  
46 --- mrd6-0.9.6.orig/src/linux/mrd_components.cpp
47 +++ mrd6-0.9.6/src/linux/mrd_components.cpp
48 @@ -92,8 +92,6 @@
49  #if defined(__GLIBC__)
50  #if defined(__i386__)
51         return (void *)base->uc_mcontext.gregs[REG_EIP];
52 -#elif defined(__mips__)
53 -       return (void *)base->uc_mcontext.gpregs[CTX_EPC];
54  #endif
55  #endif
56         return 0;
57 --- mrd6-0.9.6.orig/include/mrd/log.h
58 +++ mrd6-0.9.6/include/mrd/log.h
59 @@ -53,6 +53,12 @@
60  void stream_push_formated_type(base_stream &, const char *val);
61  void stream_push_formated_type(base_stream &, const void *val);
62  
63 +
64 +#ifdef __s390__
65 +const char *stream_type_format_parameter(size_t);
66 +void stream_push_formated_type(base_stream &, size_t val);
67 +#endif
68 +
69  /*!
70   * base log stream
71   */