diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2012-05-16 18:31:43 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-05-16 18:37:39 +0300 |
commit | fcbfccdeb0d1f25627f9be8d4ca1b886e0b184a5 (patch) | |
tree | 3e740521c1e1f3fa025f9287f4352893445052a6 /sal/android | |
parent | 62f030133d5dd1a89b2320b9f123165958d899bb (diff) |
Create the redirection thread in detached state
Change-Id: I293fa84452f00a41f4a33d4a45eee6d1a32ff761
Diffstat (limited to 'sal/android')
-rw-r--r-- | sal/android/lo-bootstrap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c index f3ba3bb70bc1..a180e62eb434 100644 --- a/sal/android/lo-bootstrap.c +++ b/sal/android/lo-bootstrap.c @@ -1779,6 +1779,7 @@ Java_org_libreoffice_android_Bootstrap_redirect_1stdio(JNIEnv* env, { static jboolean current = JNI_FALSE; pthread_t thread; + pthread_attr_t attr; (void) env; (void) clazz; @@ -1827,7 +1828,9 @@ Java_org_libreoffice_android_Bootstrap_redirect_1stdio(JNIEnv* env, close(stdout_pipe[1]); close(stderr_pipe[1]); - if (pthread_create(&thread, NULL, redirect_thread, NULL) != 0) { + if (pthread_attr_init(&attr) != 0 || + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) != 0 || + pthread_create(&thread, &attr, redirect_thread, NULL) != 0) { LOGE("redirect_stdio: Could not create thread: %s", strerror(errno)); redirect_to_null(); close(stdout_pipe[0]); |