config: workaround invocation of "config-changed" signal

There seems to be a bug in glib/ffi that hits on s390x/ppc64 architecture.
It causes @changes in nm-dns-manager.c:config_changed_cb() to be NONE,
although it is clearly set (see the related bug rh #1260577 for glib).

Workaround this, by making the argument type a plain guint.

Note that the ill behavior is caught by test_config_signal() in
"src/tests/config/test-config.c".

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1062301
This commit is contained in:
Thomas Haller 2015-09-08 21:39:40 +02:00
parent 8318672fe9
commit e7d66f1df6
2 changed files with 15 additions and 2 deletions

View file

@ -1890,7 +1890,17 @@ nm_config_class_init (NMConfigClass *config_class)
G_SIGNAL_RUN_FIRST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 3, NM_TYPE_CONFIG_DATA, NM_TYPE_CONFIG_CHANGE_FLAGS, NM_TYPE_CONFIG_DATA);
G_TYPE_NONE,
3,
NM_TYPE_CONFIG_DATA,
/* Use plain guint type for changes argument. This avoids
* glib/ffi bug https://bugzilla.redhat.com/show_bug.cgi?id=1260577 */
/* NM_TYPE_CONFIG_CHANGE_FLAGS, */
G_TYPE_UINT,
NM_TYPE_CONFIG_DATA);
G_STATIC_ASSERT_EXPR (sizeof (guint) == sizeof (NMConfigChangeFlags));
G_STATIC_ASSERT_EXPR (((gint64) ((NMConfigChangeFlags) -1)) > ((gint64) 0));
}
static void

View file

@ -807,7 +807,10 @@ test_config_signal (void)
nm_config_reload (config, SIGHUP);
/* test with subscribing two signals... */
/* test with subscribing two signals...
*
* This test exposes glib bug https://bugzilla.redhat.com/show_bug.cgi?id=1260577
* for which we however have a workaround in 'nm-config.c' */
g_signal_connect (G_OBJECT (config),
NM_CONFIG_SIGNAL_CONFIG_CHANGED,
G_CALLBACK (_test_signal_config_changed_cb2),