summaryrefslogtreecommitdiff
path: root/net-misc/cfengine/files/cfengine-3.4.5-ifconfig.patch
blob: 47107784ce0f05bcb0d3a8fc9864ab329c753e09 (plain)
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
Patch by clabbe.montjoie@gmail.com
https://bugs.gentoo.org/444532

--- src/conf.h.in.old	2012-12-28 16:18:23.000000000 +0100
+++ src/conf.h.in	2012-12-28 16:19:08.000000000 +0100
@@ -773,3 +773,6 @@
 
 /* Define to rpl_vsnprintf if the replacement function should be used. */
 #undef vsnprintf
+
+/* Define to the path for running ifconfig -a */
+#undef IFCONFIG_RUN
--- src/unix.c.old	2012-12-28 16:05:28.000000000 +0100
+++ src/unix.c	2012-12-28 16:13:15.000000000 +0100
@@ -900,7 +900,7 @@
 
     default:
 
-        if ((pp = cf_popen("/sbin/ifconfig -a", "r")) == NULL)
+        if ((pp = cf_popen(IFCONFIG_RUN, "r")) == NULL)
         {
             CfOut(cf_verbose, "", "Could not find interface info\n");
             return;
--- configure.ac.old	2012-12-29 11:38:20.000000000 +0100
+++ configure.ac	2012-12-29 11:49:11.000000000 +0100
@@ -882,6 +882,16 @@
 
 
 dnl ######################################################################
+dnl Find the path to ifconfig
+dnl ######################################################################
+
+AC_PATH_PROG(IFCONFIG_PATH,ifconfig)
+if test x"$IFCONFIG_PATH" = x"" ; then
+  AC_MSG_ERROR([Cannot found the ifconfig binary.])
+fi
+AC_DEFINE_UNQUOTED(IFCONFIG_RUN, "$IFCONFIG_PATH -a", [the path to run ifconfig -a])
+
+dnl ######################################################################
 dnl Summarize
 dnl ######################################################################