From 327e00f06358ef388f4fad5abcb016daa0ec3452 Mon Sep 17 00:00:00 2001 From: Robert Piasek Date: Mon, 22 Feb 2010 10:34:23 +0000 Subject: [PATCH] fix: use nscd -i to clear cache Signed-off-by: Robert Piasek --- src/backends/NetworkManagerGentoo.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c index 7fa1207..aa4b40c 100644 --- a/src/backends/NetworkManagerGentoo.c +++ b/src/backends/NetworkManagerGentoo.c @@ -34,6 +34,7 @@ #include "NetworkManagerGeneric.h" #include "NetworkManagerSystem.h" #include "NetworkManagerUtils.h" +#include "nm-utils.h" /* * nm_system_enable_loopback @@ -57,11 +58,9 @@ void nm_system_enable_loopback (void) */ void nm_system_update_dns (void) { - #ifdef NM_NO_NAMED - if (nm_spawn_process ("/etc/init.d/nscd status") == 0) - nm_spawn_process ("/etc/init.d/nscd restart"); - #else - nm_spawn_process("/usr/bin/killall -q nscd"); - #endif + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { + nm_info ("Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } } -- 1.7.0