summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-02-08 19:31:20 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-02-08 19:31:20 +0000
commitf00605bf5181cc0fc89f9766ad83d97759570067 (patch)
tree580c36bedf56394b0943bc5e81d9a15d3d77a367
parent7e1a9232431d950af5ce4532a924e6ea885ece2c (diff)
downloadlibapr-f00605bf5181cc0fc89f9766ad83d97759570067.tar.gz
apr_thread: Follow up to r1897207: apr_thread_current_create() compilation.
Fix compilation of apr_thread_current_create() for OS/2 and Windows. Set *current to NULL on failure. Merge r1897879 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897880 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--threadproc/beos/thread.c1
-rw-r--r--threadproc/netware/thread.c1
-rw-r--r--threadproc/os2/thread.c3
-rw-r--r--threadproc/unix/thread.c1
-rw-r--r--threadproc/win32/thread.c3
5 files changed, 7 insertions, 2 deletions
diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
index 0ce9638f6..39a5e366c 100644
--- a/threadproc/beos/thread.c
+++ b/threadproc/beos/thread.c
@@ -172,6 +172,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
stat = alloc_thread(current, attr, NULL, NULL, pool);
if (stat != APR_SUCCESS) {
+ *current = NULL;
return stat;
}
diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
index 019358a35..fd74a9685 100644
--- a/threadproc/netware/thread.c
+++ b/threadproc/netware/thread.c
@@ -207,6 +207,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
stat = alloc_thread(current, attr, NULL, NULL, pool);
if (stat != APR_SUCCESS) {
+ *current = NULL;
return stat;
}
diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
index 44f7e7b11..79b24f535 100644
--- a/threadproc/os2/thread.c
+++ b/threadproc/os2/thread.c
@@ -173,8 +173,9 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
return APR_EEXIST;
}
- stat = alloc_thread(new, attr, NULL, NULL, pool);
+ stat = alloc_thread(current, attr, NULL, NULL, pool);
if (stat != APR_SUCCESS) {
+ *current = NULL;
return stat;
}
diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
index 05eb689b8..d84d5ef0d 100644
--- a/threadproc/unix/thread.c
+++ b/threadproc/unix/thread.c
@@ -248,6 +248,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
stat = alloc_thread(current, attr, NULL, NULL, pool);
if (stat != APR_SUCCESS) {
+ *current = NULL;
return stat;
}
diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
index e7e9ebc00..19ba008aa 100644
--- a/threadproc/win32/thread.c
+++ b/threadproc/win32/thread.c
@@ -196,11 +196,12 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
stat = alloc_thread(current, attr, NULL, NULL, pool);
if (stat != APR_SUCCESS) {
+ *current = NULL;
return stat;
}
if (!(attr && attr->detach)) {
- (*new)->td = apr_os_thread_current();
+ (*current)->td = apr_os_thread_current();
}
#if APR_HAS_THREAD_LOCAL