diff options
Diffstat (limited to 'src/mm-bearer-3gpp.c')
-rw-r--r-- | src/mm-bearer-3gpp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mm-bearer-3gpp.c b/src/mm-bearer-3gpp.c index f4c79725..d9e3ed37 100644 --- a/src/mm-bearer-3gpp.c +++ b/src/mm-bearer-3gpp.c @@ -776,6 +776,14 @@ disconnect (MMBearer *self, /*****************************************************************************/ +gchar * +mm_bearer_3gpp_new_unique_path (void) +{ + static guint id = 0; + + return g_strdup_printf (MM_DBUS_BEARER_3GPP_PREFIX "/%d", id++); +} + MMBearer * mm_bearer_3gpp_new_finish (MMIfaceModem3gpp *modem, GAsyncResult *res, @@ -794,7 +802,6 @@ mm_bearer_3gpp_new (MMIfaceModem3gpp *modem, gpointer user_data) { GSimpleAsyncResult *result; - static guint id = 0; MMBearer3gpp *bearer; gchar *path; @@ -824,7 +831,7 @@ mm_bearer_3gpp_new (MMIfaceModem3gpp *modem, /* Set modem and path ONLY after having checked input properties, so that * we don't export invalid bearers. */ - path = g_strdup_printf (MM_DBUS_BEARER_3GPP_PREFIX "/%d", id++); + path = mm_bearer_3gpp_new_unique_path (); g_object_set (bearer, MM_BEARER_PATH, path, MM_BEARER_MODEM, modem, |