diff options
author | Yann Ylavic <ylavic@apache.org> | 2022-02-08 19:26:16 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2022-02-08 19:26:16 +0000 |
commit | 89682a8e2e5eb498b6c4e4ff162052c7e2406a0b (patch) | |
tree | 7995a6379e24f3fec43c63886baca0123d834e78 /threadproc | |
parent | 832ec99195140a3356df7577f3d875253335068a (diff) | |
download | apr-89682a8e2e5eb498b6c4e4ff162052c7e2406a0b.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.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897879 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r-- | threadproc/beos/thread.c | 1 | ||||
-rw-r--r-- | threadproc/netware/thread.c | 1 | ||||
-rw-r--r-- | threadproc/os2/thread.c | 3 | ||||
-rw-r--r-- | threadproc/unix/thread.c | 1 | ||||
-rw-r--r-- | threadproc/win32/thread.c | 3 |
5 files changed, 7 insertions, 2 deletions
diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 435c2c8a9..f5752a81e 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -173,6 +173,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 b45569e3f..24122119a 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -208,6 +208,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 fc3015088..e0540188d 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -174,8 +174,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 78b803727..209fe7c86 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -249,6 +249,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 68251f881..7e1c1a8be 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -186,11 +186,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 |