apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r371198 - in /apr/apr/trunk: CHANGES test/testpipe.c
Date Sun, 22 Jan 2006 05:18:15 GMT
Author: rooneg
Date: Sat Jan 21 21:18:10 2006
New Revision: 371198

URL: http://svn.apache.org/viewcvs?rev=371198&view=rev
Log:
Keep testpipe.c from hanging on win32.  Because of the way win32 pipes
work (and I totally don't understand all the details here) we don't get
all the same nonblocking semantics on win32 as we do on unix.  We do
correctly return an error when trying to set timeouts on these kind of
pipes though, so look for that and avoid falling into an uninteruptable
read later if it happens.

* test/testpipe.c
  (test_write): Don't try to make a nonblocking read if we couldn't set
   the timeout, it'll just hang.

* CHANGES: Note change.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/test/testpipe.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?rev=371198&r1=371197&r2=371198&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES (original)
+++ apr/apr/trunk/CHANGES Sat Jan 21 21:18:10 2006
@@ -1,5 +1,7 @@
 Changes for APR 1.3.0
 
+  *) Keep testpipe.c from hanging on win32. [Garrett Rooney]
+
   *) Fix assertion from double close of a handle with a rwlock on win32.
      [Evgueni Brevnov <evgueni.brevnov gmail.com>]
 

Modified: apr/apr/trunk/test/testpipe.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/test/testpipe.c?rev=371198&r1=371197&r2=371198&view=diff
==============================================================================
--- apr/apr/trunk/test/testpipe.c (original)
+++ apr/apr/trunk/test/testpipe.c Sat Jan 21 21:18:10 2006
@@ -90,9 +90,11 @@
     rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1));
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
-    rv = apr_file_read(readp, buf, &nbytes);
-    ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
-    ABTS_INT_EQUAL(tc, 0, nbytes);
+    if (!rv) {
+        rv = apr_file_read(readp, buf, &nbytes);
+        ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
+        ABTS_INT_EQUAL(tc, 0, nbytes);
+    }
 }
 
 static void read_write_notimeout(abts_case *tc, void *data)



Mime
View raw message