NetworkManager r3739 - in trunk: . src/dhcp-manager



Author: dcbw
Date: Tue Jun 10 12:59:32 2008
New Revision: 3739
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3739&view=rev

Log:
2008-06-10  Dan Williams  <dcbw redhat com>

	* configure.in
		- Add TARGET_* define to config.h to distinguish distros

	* src/dhcp-manager/nm-dhcp-manager.c
		- (dhclient_run): use distro-specific path for dhclient config file



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/dhcp-manager/nm-dhcp-manager.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Jun 10 12:59:32 2008
@@ -105,15 +105,51 @@
 			;;
 	esac
 fi
+
 AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
+if test x"$with_distro" = xredhat; then
+  AC_DEFINE(TARGET_REDHAT, 1, [Define if you have Fedora or RHEL])
+fi
+
 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
+if test x"$with_distro" = xsuse; then
+  AC_DEFINE(TARGET_SUSE, 1, [Define if you have OpenSUSE or SLES])
+fi
+
 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
+if test x"$with_distro" = xgentoo; then
+  AC_DEFINE(TARGET_GENTOO, 1, [Define if you have Gentoo])
+fi
+
 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
+if test x"$with_distro" = xdebian; then
+  AC_DEFINE(TARGET_DEBIAN, 1, [Define if you have Debian])
+fi
+
 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
+if test x"$with_distro" = xslackware; then
+  AC_DEFINE(TARGET_SLACKWARE, 1, [Define if you have Slackware])
+fi
+
 AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
+if test x"$with_distro" = xarch; then
+  AC_DEFINE(TARGET_ARCH, 1, [Define if you have Arch])
+fi
+
 AM_CONDITIONAL(TARGET_PALDO, test x"$with_distro" = xpaldo)
+if test x"$with_distro" = xpaldo; then
+  AC_DEFINE(TARGET_PALDO, 1, [Define if you have Paldo])
+fi
+
 AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
+if test x"$with_distro" = xfrugalware; then
+  AC_DEFINE(TARGET_FRUGALWARE, 1, [Define if you have Frugalware])
+fi
+
 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
+if test x"$with_distro" = xmandriva; then
+  AC_DEFINE(TARGET_MANDRIVA, 1, [Define if you have Mandriva])
+fi
 
 AC_MSG_CHECKING([Linux Wireless Extensions >= 18])
 AC_TRY_COMPILE([#ifndef __user

Modified: trunk/src/dhcp-manager/nm-dhcp-manager.c
==============================================================================
--- trunk/src/dhcp-manager/nm-dhcp-manager.c	(original)
+++ trunk/src/dhcp-manager/nm-dhcp-manager.c	Tue Jun 10 12:59:32 2008
@@ -55,6 +55,15 @@
 
 #define NM_DHCP_TIMEOUT   	45 /* DHCP timeout, in seconds */
 
+#if defined(TARGET_SUSE)
+#define DHCLIENT_CONF_PATH  SYSCONFDIR "/dhclient.conf"
+#elif defined(TARGET_DEBIAN)
+#define DHCLIENT_CONF_PATH  SYSCONFDIR "/dhcp3/dhclient.conf"
+#else
+#define DHCLIENT_CONF_PATH_FORMAT  SYSCONFDIR "/dhclient-%s.conf"
+#endif
+
+
 static const char *dhclient_binary_paths[] =
 {
 	"/sbin/dhclient",
@@ -636,7 +645,11 @@
 		goto out;
 	}
 
-	conffile = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", device->iface);
+#ifdef DHCLIENT_CONF_PATH_FORMAT
+	conffile = g_strdup_printf (DHCLIENT_CONF_PATH_FORMAT, device->iface);
+#else
+	conffile = g_strdup (DHCLIENT_CONF_PATH);
+#endif
 	if (!conffile) {
 		nm_warning ("%s: not enough memory for dhclient options.", device->iface);
 		goto out;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]