base-modem: fix modem_sync() operation handling
The mm_base_modem_sync() method is an asynchronous method that receives a callback and user data, and therefore we MUST always complete the async method calling that callback. Set that up with a GTask as usual. Also, the mm_base_modem_sync_finish() method should be implemented along with mm_base_modem_sync(), not in the source file of the caller of the async method. The finish() always depends on how the async method was implemented, in our case using a GTask.
This commit is contained in:
@@ -729,13 +729,6 @@ mm_base_manager_num_modems (MMBaseManager *self)
|
||||
|
||||
#if defined WITH_SYSTEMD_SUSPEND_RESUME
|
||||
|
||||
gboolean mm_base_modem_sync_finish (MMBaseModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return g_task_propagate_boolean (G_TASK (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
base_modem_sync_ready (MMBaseModem *self,
|
||||
GAsyncResult *res,
|
||||
|
Reference in New Issue
Block a user