apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1539462 - in /apr/apr/branches/1.5.x: ./ CHANGES file_io/win32/filedup.c
Date Wed, 06 Nov 2013 21:04:40 GMT
Author: trawick
Date: Wed Nov  6 21:04:40 2013
New Revision: 1539462

URL: http://svn.apache.org/r1539462
Log:
Merge r1539455 from trunk:

apr_file_dup2() on Windows: Fix debug RTL assertion when attempting to 
_commit(stdout) or _commit(stderr).

Submitted by: Mike Rumph <mike.rumph oracle.com>
Reviewed by trawick, who adjusted the patch to remove the existing _commit(stdin)

Modified:
    apr/apr/branches/1.5.x/   (props changed)
    apr/apr/branches/1.5.x/CHANGES
    apr/apr/branches/1.5.x/file_io/win32/filedup.c

Propchange: apr/apr/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1539455

Modified: apr/apr/branches/1.5.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/CHANGES?rev=1539462&r1=1539461&r2=1539462&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.5.x/CHANGES [utf-8] Wed Nov  6 21:04:40 2013
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.5.0
 
+  *) apr_file_dup2() on Windows: Fix debug RTL assertion in when 
+     attempting to _commit(stdout) or _commit(stderr).  [Mike Rumph
+     <mike.rumph oracle.com>]
+
   *) apr_socket_connect() on Windows: Handle WSAEISCONN.  PR 48736.
      [<inoue ariel-networks.com>, Jeff Trawick]
 

Modified: apr/apr/branches/1.5.x/file_io/win32/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/win32/filedup.c?rev=1539462&r1=1539461&r2=1539462&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/win32/filedup.c (original)
+++ apr/apr/branches/1.5.x/file_io/win32/filedup.c Wed Nov  6 21:04:40 2013
@@ -88,7 +88,9 @@ APR_DECLARE(apr_status_t) apr_file_dup2(
              */
             fflush(stderr);
             setvbuf(stderr, NULL, _IONBF, 0);
-            _commit(2 /* stderr */);
+            if (!_isatty(2)) {
+                _commit(2 /* stderr */);
+            }
 
             /* Clone a handle can _close() without harming the source handle,
              * open an MSVCRT-based pseudo-fd for the file handle, then dup2
@@ -118,7 +120,9 @@ APR_DECLARE(apr_status_t) apr_file_dup2(
             /* For the process flow see the stderr case above */
             fflush(stdout);
             setvbuf(stdout, NULL, _IONBF, 0);
-            _commit(1 /* stdout */);
+            if (!_isatty(1)) {
+                _commit(1 /* stdout */);
+            }
 
             if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand,
                                  0, FALSE, DUPLICATE_SAME_ACCESS)) {
@@ -134,7 +138,6 @@ APR_DECLARE(apr_status_t) apr_file_dup2(
             /* For the process flow see the stderr case above */
             fflush(stdin);
             setvbuf(stdin, NULL, _IONBF, 0);
-            _commit(0 /* stdin */);
 
             if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand,
                                  0, FALSE, DUPLICATE_SAME_ACCESS)) {



Mime
View raw message