This fixes commit 66f10d61a2
("iface-modem: port mm_iface_modem_initialize to use GTask"), which
didn't update mm_iface_modem_initialize_finish to use
g_task_propagate_boolean.
CC ModemManager-mm-broadband-modem-mbim.o
mm-broadband-modem-mbim.c: In function ‘mbim_port_open_ready’:
mm-broadband-modem-mbim.c:1581:35: error: unused variable ‘ctx’ [-Werror=unused-variable]
InitializationStartedContext *ctx;
^~~
cc1: all warnings being treated as errors
mm_plugin_supports_port_finish directly casts the value returned by
g_task_propagate_int to MMPluginSupportsResult enum value, which
implicitly assumes MM_PLUGIN_SUPPORTS_PORT_UNKNOWN equals to -1.
Instead of relying on such an implicit assumption, this patch modifies
the code to check if the GError argument to g_task_propagate_error is
populated instead.
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.
The mm_base_modem_at_command() async calls keep a modem reference
valid for as long as the operation and its completion handler are run,
so there really is no need for the caller (the call operation) to keep
a reference to the modem object itself.
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.