This is for pacrunner.

---
 src/client.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/client.c b/src/client.c
index d354c2b..8d1e22b 100644
--- a/src/client.c
+++ b/src/client.c
@@ -84,6 +84,7 @@ static DBusMessage *find_proxy_for_url(DBusConnection *conn,
                                        DBusMessage *msg, void *user_data)
 {
        struct jsrun_data *jsrun;
+       pthread_attr_t attrs;
 
        jsrun = g_try_new0(struct jsrun_data, 1);
        if (!jsrun)
@@ -94,7 +95,9 @@ static DBusMessage *find_proxy_for_url(DBusConnection *conn,
        jsrun->conn = dbus_connection_ref(conn);
        jsrun->msg = dbus_message_ref(msg);
 
-       if (pthread_create(&jsrun->thread, NULL, jsrun_thread, jsrun) != 0) {
+       pthread_attr_init(&attrs);
+       pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
+       if (pthread_create(&jsrun->thread, &attrs, jsrun_thread, jsrun) != 0) {
                jsrun_free(jsrun);
                return g_dbus_create_error(msg,
                                        PACRUNNER_ERROR_INTERFACE ".Failed",
-- 
1.8.3.2

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to