[Spice-devel] [spice-gtk v1 2/5] win-usb-dev: pass GError to g_udev_client_new()
Christophe Fergeau
cfergeau at redhat.com
Tue Nov 15 10:45:25 UTC 2016
I think I'd say "Report error" rather than "Pass error" in the shortlog
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
On Tue, Nov 15, 2016 at 12:26:52AM +0100, Victor Toso wrote:
> From: Victor Toso <me at victortoso.com>
>
> Otherwise application will not be able to know the reason for failure.
> Signed-off-by: Victor Toso <victortoso at redhat.com>
> ---
> src/usb-device-manager.c | 2 +-
> src/win-usb-dev.c | 4 ++--
> src/win-usb-dev.h | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index 6f9ed5d..3d4bd98 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -320,7 +320,7 @@ static gboolean spice_usb_device_manager_initable_init(GInitable *initable,
>
> /* Start listening for usb devices plug / unplug */
> #ifdef USE_GUDEV
> - priv->udev = g_udev_client_new(subsystems);
> + priv->udev = g_udev_client_new(subsystems, err);
> g_signal_connect(G_OBJECT(priv->udev), "uevent",
> G_CALLBACK(spice_usb_device_manager_uevent_cb), self);
> /* Do coldplug (detection of already connected devices) */
> diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
> index a857b02..4b95b2d 100644
> --- a/src/win-usb-dev.c
> +++ b/src/win-usb-dev.c
> @@ -106,12 +106,12 @@ GQuark g_udev_client_error_quark(void)
> return g_quark_from_static_string("win-gudev-client-error-quark");
> }
>
> -GUdevClient *g_udev_client_new(const gchar* const *subsystems)
> +GUdevClient *g_udev_client_new(const gchar* const *subsystems, GError **error)
> {
> if (singleton != NULL)
> return g_object_ref(singleton);
>
> - singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, NULL, NULL);
> + singleton = g_initable_new(G_UDEV_TYPE_CLIENT, NULL, error, NULL);
> return singleton;
> }
>
> diff --git a/src/win-usb-dev.h b/src/win-usb-dev.h
> index b5c4fce..a9562ab 100644
> --- a/src/win-usb-dev.h
> +++ b/src/win-usb-dev.h
> @@ -79,7 +79,7 @@ struct _GUdevClientClass
> };
>
> GType g_udev_client_get_type(void) G_GNUC_CONST;
> -GUdevClient *g_udev_client_new(const gchar* const *subsystems);
> +GUdevClient *g_udev_client_new(const gchar* const *subsystems, GError **error);
> GList *g_udev_client_query_by_subsystem(GUdevClient *client, const gchar *subsystem);
>
> GType g_udev_device_get_type(void) G_GNUC_CONST;
> --
> 2.9.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161115/43f89d71/attachment.sig>
More information about the Spice-devel
mailing list