diff options
| author | Michael Biebl <biebl@debian.org> | 2012-06-29 20:12:59 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2012-06-29 20:12:59 +0200 |
| commit | ec7b2a4d322996da1e4b221f2f713652bf868d3b (patch) | |
| tree | 88cd588a74c0de932f7cac871273b08b86fd759c /src/settings/plugins/ifcfg-rh/reader.c | |
| parent | 1376a21247cfd9d8bb1d4da7195112d03ff6e870 (diff) | |
| parent | 867254ea7c2b193fecf8cd36cc6e5dc53c290d92 (diff) | |
Merge tag 'upstream/0.9.5.95' into experimental
Upstream version 0.9.5.95
Diffstat (limited to 'src/settings/plugins/ifcfg-rh/reader.c')
| -rw-r--r-- | src/settings/plugins/ifcfg-rh/reader.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 01d83c1b..a2b08e4f 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -48,6 +48,7 @@ #include <nm-utils.h> #include "wifi-utils.h" +#include "nm-posix-signals.h" #include "common.h" #include "shvar.h" @@ -208,6 +209,12 @@ iscsiadm_child_setup (gpointer user_data G_GNUC_UNUSED) */ pid_t pid = getpid (); setpgid (pid, pid); + + /* + * We blocked signals in main(). We need to restore original signal + * mask for iscsiadm here so that it can receive signals. + */ + nm_unblock_posix_signals (NULL); } static char * @@ -3732,8 +3739,8 @@ make_vlan_setting (shvarFile *ifcfg, char *value = NULL; char *iface_name = NULL; char *parent = NULL; - const char *p = NULL, *w; - gboolean has_numbers = FALSE; + const char *p = NULL; + char *end = NULL; gint vlan_id = -1; guint32 vlan_flags = 0; @@ -3773,17 +3780,12 @@ make_vlan_setting (shvarFile *ifcfg, p = iface_name + 4; } - w = p; - while (*w && !has_numbers) - has_numbers = g_ascii_isdigit (*w); - - /* Grab VLAN ID from interface name; this takes precedence over the - * separate VLAN_ID property for backwards compat. - */ - if (has_numbers) { - errno = 0; - vlan_id = (gint) g_ascii_strtoll (p, NULL, 10); - if (vlan_id < 0 || vlan_id > 4095 || errno) { + if (p) { + /* Grab VLAN ID from interface name; this takes precedence over the + * separate VLAN_ID property for backwards compat. + */ + vlan_id = (gint) g_ascii_strtoll (p, &end, 10); + if (vlan_id < 0 || vlan_id > 4095 || end == p || *end) { g_set_error (error, IFCFG_PLUGIN_ERROR, 0, "Failed to determine VLAN ID from DEVICE '%s'", iface_name); |