diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-09-10 10:56:52 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2018-09-12 17:15:46 +0000 |
commit | 48d2fa399ac55ff5a59224b3ab5e475f1ddc394b (patch) | |
tree | 28616c0b8438fbb8016f6dfacd8b265025cdf589 | |
parent | e3c2f0e9cccd26794e4fa54dcd8663d97e129414 (diff) | |
download | ModemManager-48d2fa399ac55ff5a59224b3ab5e475f1ddc394b.tar.gz |
port-serial: Flow Control property is flags, not enum
MMFlowControl is a flags enumeration, so change the property type to
match that, or we'll end up with nasty criticals during runtime.
(ModemManager:30758): GLib-GObject-CRITICAL **: 10:54:26.435: g_param_spec_enum: assertion 'G_TYPE_IS_ENUM (enum_type)' failed
Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff71f2a96 in ?? () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0 0x00007ffff71f2a96 in () at /usr/lib/libglib-2.0.so.0
#1 0x00007ffff71f3def in g_logv () at /usr/lib/libglib-2.0.so.0
#2 0x00007ffff71f3fe0 in g_log () at /usr/lib/libglib-2.0.so.0
#3 0x00007ffff72d90ac in g_param_spec_enum () at /usr/lib/libgobject-2.0.so.0
#4 0x000055555564caf2 in mm_port_serial_class_init (klass=0x5555557607c0) at mm-port-serial.c:2101
#5 0x000055555564759a in mm_port_serial_class_intern_init (klass=0x5555557607c0) at mm-port-serial.c:49
#6 0x00007ffff72ea9b4 in g_type_class_ref () at /usr/lib/libgobject-2.0.so.0
#7 0x00007ffff72eab5a in g_type_class_ref () at /usr/lib/libgobject-2.0.so.0
#8 0x00007ffff72d0f53 in g_object_new_valist () at /usr/lib/libgobject-2.0.so.0
#9 0x00007ffff72d103a in g_object_new () at /usr/lib/libgobject-2.0.so.0
#10 0x000055555564e187 in mm_port_serial_at_new (name=0x55555576e280 "ttyUSB4", subsys=MM_PORT_SUBSYS_TTY) at mm-port-serial-at.c:533
#11 0x0000555555602512 in serial_open_at (self=0x555555715390) at mm-port-probe.c:1285
#12 0x00007ffff71ecb49 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#13 0x00007ffff71ecf59 in () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff71ed272 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#15 0x00005555555957e0 in main (argc=3, argv=0x7fffffffe458) at
main.c:181
Also, rename the property to match the naming convention of other
properties in the same object.
-rw-r--r-- | src/mm-port-serial.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mm-port-serial.c b/src/mm-port-serial.c index ff02213ec..e53421e37 100644 --- a/src/mm-port-serial.c +++ b/src/mm-port-serial.c @@ -1957,7 +1957,7 @@ set_property (GObject *object, self->priv->stopbits = g_value_get_uint (value); break; case PROP_FLOW_CONTROL: - self->priv->flow_control = g_value_get_enum (value); + self->priv->flow_control = g_value_get_flags (value); break; case PROP_SEND_DELAY: self->priv->send_delay = g_value_get_uint64 (value); @@ -1999,7 +1999,7 @@ get_property (GObject *object, g_value_set_uint (value, self->priv->stopbits); break; case PROP_FLOW_CONTROL: - g_value_set_enum (value, self->priv->flow_control); + g_value_set_flags (value, self->priv->flow_control); break; case PROP_SEND_DELAY: g_value_set_uint64 (value, self->priv->send_delay); @@ -2100,12 +2100,12 @@ mm_port_serial_class_init (MMPortSerialClass *klass) g_object_class_install_property (object_class, PROP_FLOW_CONTROL, - g_param_spec_enum (MM_PORT_SERIAL_FLOW_CONTROL, - "flowcontrol", - "Select flow control (see MMFlowControl definition)", - MM_TYPE_FLOW_CONTROL, - MM_FLOW_CONTROL_UNKNOWN, - G_PARAM_READWRITE)); + g_param_spec_flags (MM_PORT_SERIAL_FLOW_CONTROL, + "FlowControl", + "Select flow control", + MM_TYPE_FLOW_CONTROL, + MM_FLOW_CONTROL_UNKNOWN, + G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_SEND_DELAY, |