NetworkManager r4082 - trunk/src
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r4082 - trunk/src
- Date: Fri, 19 Sep 2008 17:40:48 +0000 (UTC)
Author: dcbw
Date: Fri Sep 19 17:40:48 2008
New Revision: 4082
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4082&view=rev
Log:
Check return value of sethostname(2)
Modified:
trunk/src/NetworkManagerPolicy.c
Modified: trunk/src/NetworkManagerPolicy.c
==============================================================================
--- trunk/src/NetworkManagerPolicy.c (original)
+++ trunk/src/NetworkManagerPolicy.c Fri Sep 19 17:40:48 2008
@@ -360,7 +360,11 @@
if (!update_etc_hosts (name)) {
/* error updating /etc/hosts; fallback to localhost.localdomain */
nm_info ("Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)");
- sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME));
+ ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME));
+ if (ret != 0) {
+ nm_warning ("%s: couldn't set the fallback system hostname (%s): (%d) %s",
+ __func__, FALLBACK_HOSTNAME, errno, strerror (errno));
+ }
}
} else {
nm_warning ("%s: couldn't set the system hostname to '%s': (%d) %s",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]