The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / portmap / 0004-NO_PERROR-control-overriding-of-perror-symbol.patch
1 From 8cea0778f0fb838a7bd764be08f15e1494e5a0b2 Mon Sep 17 00:00:00 2001
2 From: Mike Frysinger <vapier@gentoo.org>
3 Date: Fri, 19 Nov 2010 23:50:27 -0500
4 Subject: [PATCH 4/4] NO_PERROR: control overriding of perror() symbol
5
6 Doing static builds of portmap might fail when the C library's perror()
7 function is pulled in and collides with portmap's definition.  So add a
8 flag to control the local override.
9
10 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 ---
12  Makefile |    5 +++++
13  README   |    1 +
14  2 files changed, 6 insertions(+), 0 deletions(-)
15
16 diff --git a/Makefile b/Makefile
17 index 9df5574..1635107 100644
18 --- a/Makefile
19 +++ b/Makefile
20 @@ -32,6 +32,11 @@ ifneq ($(NO_FORK),)
21  CPPFLAGS += -DNO_FORK
22  endif
23  
24 +# For static builds, we might hit perror() symbol clashes
25 +ifneq ($(NO_PERROR),)
26 +CPPFLAGS += -DNO_PERROR
27 +endif
28 +
29  # Comment out if your RPC library does not allocate privileged ports for
30  # requests from processes with root privilege, or the new portmap will
31  # always reject requests to register/unregister services on privileged
32 diff --git a/README b/README
33 index bda1707..05861a8 100644
34 --- a/README
35 +++ b/README
36 @@ -19,6 +19,7 @@ There is no "./configure", just use "make".
37  Some make variable can be used to control compilation.
38  
39   NO_FORK=        if non-empty, don't use fork (good for nommu systems)
40 + NO_PERROR=      if non-empty, don't override the perror() func
41   NO_PIE=         if non-empty, don't build portmap as a PIE
42   NO_TCP_WRAPPER=  if non-empty, don't use tcp_wrappers
43   USE_DNS=        if set, tcp_wrappers can check peers based on hostname
44 diff --git a/portmap.c b/portmap.c
45 index 2a98881..94abc64 100644
46 --- a/portmap.c
47 +++ b/portmap.c
48 @@ -391,12 +391,14 @@ main(int argc, char **argv)
49         abort();
50  }
51  
52 +#ifndef NO_PERROR
53  /* need to override perror calls in rpc library */
54  void perror(const char *what)
55  {
56  
57         syslog(LOG_ERR, "%s: %m", what);
58  }
59 +#endif
60  
61  static struct pmaplist *
62  find_service(u_long prog, u_long vers, u_long prot)
63 -- 
64 1.7.3.1
65