Commit c8a166a5 authored by Yuri Benditovich's avatar Yuri Benditovich Committed by Victor Toso

usb-redir: use g_thread_try_new instead of g_thread_new

Newer API (glib 2.32) is safe, in case of error it does not
abort the process and returns error information.
Signed-off-by: Yuri Benditovich's avatarYuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: 's avatarVictor Toso <victortoso@redhat.com>
parent 89a9d391
Pipeline #50846 passed with stage
in 4 minutes and 35 seconds
......@@ -473,9 +473,14 @@ gboolean spice_usb_backend_register_hotplug(SpiceUsbBackend *be,
}
g_atomic_int_set(&be->event_thread_run, TRUE);
be->event_thread = g_thread_new("usb_ev_thread",
handle_libusb_events,
be);
be->event_thread = g_thread_try_new("usb_ev_thread",
handle_libusb_events,
be, error);
if (!be->event_thread) {
g_warning("Error starting event thread");
spice_usb_backend_deregister_hotplug(be);
return FALSE;
}
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment