You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by iv...@apache.org on 2023/01/21 16:08:49 UTC
svn commit: r1906888 - /apr/apr/trunk/threadproc/win32/proc.c
Author: ivan
Date: Sat Jan 21 16:08:49 2023
New Revision: 1906888
URL: http://svn.apache.org/viewvc?rev=1906888&view=rev
Log:
Follow-up to r1906885.
* threadproc/win32/proc.c
(apr_proc_create): Close redirect pipes only on success to match pre-r1906885
behavior.
Modified:
apr/apr/trunk/threadproc/win32/proc.c
Modified: apr/apr/trunk/threadproc/win32/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/win32/proc.c?rev=1906888&r1=1906887&r2=1906888&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/win32/proc.c (original)
+++ apr/apr/trunk/threadproc/win32/proc.c Sat Jan 21 16:08:49 2023
@@ -916,18 +916,20 @@ APR_DECLARE(apr_status_t) apr_proc_creat
stderr_reset, stderr_reset);
}
- /* Close our side of pipes before releasing lock: otherwise they
- * could like to other process when apr_proc_create() is used from
- * from multiple threads.
- */
- if ((attr->child_in) && (attr->child_in != &no_file)) {
- apr_file_close(attr->child_in);
- }
- if ((attr->child_out) && (attr->child_out != &no_file)) {
- apr_file_close(attr->child_out);
- }
- if ((attr->child_err) && (attr->child_err != &no_file)) {
- apr_file_close(attr->child_err);
+ if (rv == APR_SUCCESS) {
+ /* Close our side of pipes before releasing lock: otherwise they
+ * could like to other process when apr_proc_create() is used from
+ * from multiple threads.
+ */
+ if ((attr->child_in) && (attr->child_in != &no_file)) {
+ apr_file_close(attr->child_in);
+ }
+ if ((attr->child_out) && (attr->child_out != &no_file)) {
+ apr_file_close(attr->child_out);
+ }
+ if ((attr->child_err) && (attr->child_err != &no_file)) {
+ apr_file_close(attr->child_err);
+ }
}
/* RELEASE CRITICAL SECTION