[PATCH] honour exit code of resolvconf
- From: Alexander Sack <asac jwsdot com>
- To: networkmanager-list gnome org
- Subject: [PATCH] honour exit code of resolvconf
- Date: Fri, 12 Sep 2008 13:30:14 +0200
We need honour the exit code of resolvconf. Otherwise NM wont detect
that resolvconf failed (e.g. in case /etc/resolv.conf isnt a symlink)
and then dont update resolv.conf at all.
Patch attached.
- Alexander
=== modified file 'src/named-manager/nm-named-manager.c'
--- a/src/named-manager/nm-named-manager.c 2008-09-05 18:57:07 +0000
+++ b/src/named-manager/nm-named-manager.c 2008-09-09 13:58:11 +0000
@@ -286,17 +286,17 @@ dispatch_resolvconf (const char *domain,
g_set_error (error,
NM_NAMED_MANAGER_ERROR,
NM_NAMED_MANAGER_ERROR_SYSTEM,
"Could not write to %s: %s\n",
RESOLVCONF_PATH,
g_strerror (errno));
else {
retval = write_resolv_conf (f, domain, searches, nameservers, error);
- pclose (f);
+ retval &= pclose (f) == 0;
}
} else {
cmd = g_strconcat (RESOLVCONF_PATH, " -d ", "NetworkManager", NULL);
nm_info ("(%s): removing resolv.conf from %s", iface, RESOLVCONF_PATH);
if (nm_spawn_process (cmd) == 0)
retval = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]