apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1734816 - in /apr/apr/trunk: CHANGES file_io/netware/pipe.c file_io/os2/pipe.c file_io/unix/pipe.c file_io/win32/pipe.c include/apr_file_io.h test/testpipe.c
Date Sun, 13 Mar 2016 15:09:03 GMT
Author: minfrin
Date: Sun Mar 13 15:09:03 2016
New Revision: 1734816

URL: http://svn.apache.org/viewvc?rev=1734816&view=rev
Log:
apr_file_io: Add apr_file_pipe_create_pools() allowing a pair of
pipes to be created, each in a different pool.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/file_io/netware/pipe.c
    apr/apr/trunk/file_io/os2/pipe.c
    apr/apr/trunk/file_io/unix/pipe.c
    apr/apr/trunk/file_io/win32/pipe.c
    apr/apr/trunk/include/apr_file_io.h
    apr/apr/trunk/test/testpipe.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=1734816&r1=1734815&r2=1734816&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Sun Mar 13 15:09:03 2016
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.0
 
+  *) apr_file_io: Add apr_file_pipe_create_pools() allowing a pair of
+     pipes to be created, each in a different pool. [Graham Leggett]
+
   *) apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when
      overlapping tables. [Graham Leggett]
 

Modified: apr/apr/trunk/file_io/netware/pipe.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/netware/pipe.c?rev=1734816&r1=1734815&r2=1734816&view=diff
==============================================================================
--- apr/apr/trunk/file_io/netware/pipe.c (original)
+++ apr/apr/trunk/file_io/netware/pipe.c Sun Mar 13 15:09:03 2016
@@ -133,7 +133,8 @@ APR_DECLARE(apr_status_t) apr_os_pipe_pu
     return apr_os_pipe_put_ex(file, thefile, 0, pool);
 }
 
-APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t
*pool)
+static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out,
+        apr_pool_t *pool_in, apr_pool_t *pool_out)
 {
     int         filedes[2];
 
@@ -141,11 +142,11 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
         return errno;
     }
 
-    (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
-    (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
+    (*in) = (apr_file_t *)apr_pcalloc(pool_in, sizeof(apr_file_t));
+    (*out) = (apr_file_t *)apr_pcalloc(pool_out, sizeof(apr_file_t));
 
-    (*in)->pool     =
-    (*out)->pool    = pool;
+    (*in)->pool     = pool_in;
+    (*out)->pool    = pool_out;
     (*in)->filedes   = filedes[0];
     (*out)->filedes  = filedes[1];
     (*in)->flags     = APR_INHERIT;
@@ -163,8 +164,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
     (*in)->ungetchar = -1;
     (*in)->thlock    =
     (*out)->thlock   = NULL;
-    (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0);
-    (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0);
+    (void) apr_pollset_create(&(*in)->pollset, 1, pool_in, 0);
+    (void) apr_pollset_create(&(*out)->pollset, 1, pool_out, 0);
 
     apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup,
                          apr_pool_cleanup_null);
@@ -174,6 +175,30 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
     return APR_SUCCESS;
 }
 
+static void file_pipe_block(apr_file_t **in, apr_file_t **out,
+        apr_int32_t blocking)
+{
+    switch (blocking) {
+    case APR_FULL_BLOCK:
+        break;
+    case APR_READ_BLOCK:
+        apr_file_pipe_timeout_set(*out, 0);
+        break;
+    case APR_WRITE_BLOCK:
+        apr_file_pipe_timeout_set(*in, 0);
+        break;
+    default:
+        apr_file_pipe_timeout_set(*out, 0);
+        apr_file_pipe_timeout_set(*in, 0);
+        break;
+    }
+}
+
+APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t
*pool)
+{
+    return file_pipe_create(in, out, pool, pool);
+}
+
 APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, 
                                                   apr_file_t **out, 
                                                   apr_int32_t blocking,
@@ -181,23 +206,26 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
 {
     apr_status_t status;
 
-    if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS)
+    if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) {
         return status;
+    }
 
-    switch (blocking) {
-        case APR_FULL_BLOCK:
-            break;
-        case APR_READ_BLOCK:
-            apr_file_pipe_timeout_set(*out, 0);
-            break;
-        case APR_WRITE_BLOCK:
-            apr_file_pipe_timeout_set(*in, 0);
-            break;
-        default:
-            apr_file_pipe_timeout_set(*out, 0);
-            apr_file_pipe_timeout_set(*in, 0);
+    file_pipe_block(in, out, blocking);
+
+    return APR_SUCCESS;
+}
+
+APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in,
+        apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool_in, apr_pool_t *pool_out)
+{
+    apr_status_t status;
+
+    if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) {
+        return status;
     }
 
+    file_pipe_block(in, out, blocking);
+
     return APR_SUCCESS;
 }
 

Modified: apr/apr/trunk/file_io/os2/pipe.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/os2/pipe.c?rev=1734816&r1=1734815&r2=1734816&view=diff
==============================================================================
--- apr/apr/trunk/file_io/os2/pipe.c (original)
+++ apr/apr/trunk/file_io/os2/pipe.c Sun Mar 13 15:09:03 2016
@@ -24,7 +24,8 @@
 #include <string.h>
 #include <process.h>
 
-APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t
*pool)
+static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out,
+        apr_pool_t *pool_in, apr_pool_t *pool_out)
 {
     ULONG filedes[2];
     ULONG rc, action;
@@ -54,7 +55,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
         return APR_FROM_OS_ERROR(rc);
     }
 
-    (*in) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t));
+    (*in) = (apr_file_t *)apr_palloc(pool_in, sizeof(apr_file_t));
     rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE);
 
     if (rc) {
@@ -76,9 +77,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
         return APR_FROM_OS_ERROR(rc);
     }
 
-    (*in)->pool = pool;
+    (*in)->pool = pool_in;
     (*in)->filedes = filedes[0];
-    (*in)->fname = apr_pstrdup(pool, pipename);
+    (*in)->fname = apr_pstrdup(pool_in, pipename);
     (*in)->isopen = TRUE;
     (*in)->buffered = FALSE;
     (*in)->flags = APR_FOPEN_READ;
@@ -86,9 +87,10 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
     (*in)->timeout = -1;
     (*in)->blocking = BLK_ON;
     (*in)->ungetchar = -1;
-    apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null);
+    apr_pool_cleanup_register(pool_in, *in, apr_file_cleanup,
+            apr_pool_cleanup_null);
 
-    (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t));
+    (*out) = (apr_file_t *)apr_palloc(pool_out, sizeof(apr_file_t));
     rc = DosCreateEventSem(NULL, &(*out)->pipeSem, DC_SEM_SHARED, FALSE);
 
     if (rc) {
@@ -108,9 +110,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
         return APR_FROM_OS_ERROR(rc);
     }
 
-    (*out)->pool = pool;
+    (*out)->pool = pool_out;
     (*out)->filedes = filedes[1];
-    (*out)->fname = apr_pstrdup(pool, pipename);
+    (*out)->fname = apr_pstrdup(pool_out, pipename);
     (*out)->isopen = TRUE;
     (*out)->buffered = FALSE;
     (*out)->flags = APR_FOPEN_WRITE;
@@ -118,12 +120,37 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
     (*out)->timeout = -1;
     (*out)->blocking = BLK_ON;
     (*out)->ungetchar = -1;
-    apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null);
+    apr_pool_cleanup_register(pool_out, *out, apr_file_cleanup,
+            apr_pool_cleanup_null);
 
     return APR_SUCCESS;
 }
 
+static void file_pipe_block(apr_file_t **in, apr_file_t **out,
+        apr_int32_t blocking)
+{
+    switch (blocking) {
+    case APR_FULL_BLOCK:
+        break;
+    case APR_READ_BLOCK:
+        apr_file_pipe_timeout_set(*out, 0);
+        break;
+    case APR_WRITE_BLOCK:
+        apr_file_pipe_timeout_set(*in, 0);
+        break;
+    default:
+        apr_file_pipe_timeout_set(*out, 0);
+        apr_file_pipe_timeout_set(*in, 0);
+        break;
+    }
+}
 
+APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in,
+                                               apr_file_t **out,
+                                               apr_pool_t *pool)
+{
+    return file_pipe_create(in, out, pool, pool);
+}
 
 APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, 
                                                   apr_file_t **out, 
@@ -132,26 +159,29 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
 {
     apr_status_t status;
 
-    if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS)
+    if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS)
         return status;
 
-    switch (blocking) {
-        case APR_FULL_BLOCK:
-            break;
-        case APR_READ_BLOCK:
-            apr_file_pipe_timeout_set(*out, 0);
-            break;
-        case APR_WRITE_BLOCK:
-            apr_file_pipe_timeout_set(*in, 0);
-            break;
-        default:
-            apr_file_pipe_timeout_set(*out, 0);
-            apr_file_pipe_timeout_set(*in, 0);
-    }
+    file_pipe_block(in, out, blocking);
 
     return APR_SUCCESS;
 }
 
+APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in,
+                                                     apr_file_t **out,
+                                                     apr_int32_t blocking,
+                                                     apr_pool_t *pool_in,
+                                                     apr_pool_t *pool_out)
+{
+    apr_status_t status;
+
+    if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS)
+        return status;
+
+    file_pipe_block(in, out, blocking);
+
+    return APR_SUCCESS;
+}
     
     
 APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t
perm, apr_pool_t *pool)

Modified: apr/apr/trunk/file_io/unix/pipe.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/pipe.c?rev=1734816&r1=1734815&r2=1734816&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/pipe.c (original)
+++ apr/apr/trunk/file_io/unix/pipe.c Sun Mar 13 15:09:03 2016
@@ -176,7 +176,8 @@ APR_DECLARE(apr_status_t) apr_os_pipe_pu
     return apr_os_pipe_put_ex(file, thefile, 0, pool);
 }
 
-APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t
*pool)
+static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out,
+        apr_pool_t *pool_in, apr_pool_t *pool_out)
 {
     int filedes[2];
 
@@ -184,8 +185,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
         return errno;
     }
     
-    (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
-    (*in)->pool = pool;
+    (*in) = (apr_file_t *)apr_pcalloc(pool_in, sizeof(apr_file_t));
+    (*in)->pool = pool_in;
     (*in)->filedes = filedes[0];
     (*in)->is_pipe = 1;
     (*in)->fname = NULL;
@@ -200,8 +201,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
 #ifndef WAITIO_USES_POLL
     (*in)->pollset = NULL;
 #endif
-    (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
-    (*out)->pool = pool;
+    (*out) = (apr_file_t *)apr_pcalloc(pool_out, sizeof(apr_file_t));
+    (*out)->pool = pool_out;
     (*out)->filedes = filedes[1];
     (*out)->is_pipe = 1;
     (*out)->fname = NULL;
@@ -222,6 +223,30 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
     return APR_SUCCESS;
 }
 
+static void file_pipe_block(apr_file_t **in, apr_file_t **out, apr_int32_t blocking)
+{
+    switch (blocking) {
+    case APR_FULL_BLOCK:
+        break;
+    case APR_READ_BLOCK:
+        apr_file_pipe_timeout_set(*out, 0);
+        break;
+    case APR_WRITE_BLOCK:
+        apr_file_pipe_timeout_set(*in, 0);
+        break;
+    default:
+        apr_file_pipe_timeout_set(*out, 0);
+        apr_file_pipe_timeout_set(*in, 0);
+        break;
+    }
+}
+
+APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in,
+        apr_file_t **out, apr_pool_t *pool)
+{
+    return file_pipe_create(in, out, pool, pool);
+}
+
 APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, 
                                                   apr_file_t **out, 
                                                   apr_int32_t blocking,
@@ -229,23 +254,26 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
 {
     apr_status_t status;
 
-    if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS)
+    if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) {
         return status;
+    }
 
-    switch (blocking) {
-        case APR_FULL_BLOCK:
-            break;
-        case APR_READ_BLOCK:
-            apr_file_pipe_timeout_set(*out, 0);
-            break;
-        case APR_WRITE_BLOCK:
-            apr_file_pipe_timeout_set(*in, 0);
-            break;
-        default:
-            apr_file_pipe_timeout_set(*out, 0);
-            apr_file_pipe_timeout_set(*in, 0);
+    file_pipe_block(in, out, blocking);
+
+    return APR_SUCCESS;
+}
+
+APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in,
+        apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool_in, apr_pool_t *pool_out)
+{
+    apr_status_t status;
+
+    if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) {
+        return status;
     }
 
+    file_pipe_block(in, out, blocking);
+
     return APR_SUCCESS;
 }
 

Modified: apr/apr/trunk/file_io/win32/pipe.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/pipe.c?rev=1734816&r1=1734815&r2=1734816&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/pipe.c (original)
+++ apr/apr/trunk/file_io/win32/pipe.c Sun Mar 13 15:09:03 2016
@@ -68,7 +68,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
                                                apr_pool_t *p)
 {
     /* Unix creates full blocking pipes. */
-    return apr_file_pipe_create_ex(in, out, APR_FULL_BLOCK, p);
+    return apr_file_pipe_create_pools(in, out, APR_FULL_BLOCK, p, p);
 }
 
 APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
@@ -76,6 +76,15 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
                                                   apr_int32_t blocking,
                                                   apr_pool_t *p)
 {
+    return apr_file_pipe_create_pools(in, out, APR_FULL_BLOCK, p, p);
+}
+
+APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in,
+                                                     apr_file_t **out,
+                                                     apr_int32_t blocking,
+                                                     apr_pool_t *pool_in,
+                                                     apr_pool_t *pool_out)
+{
 #ifdef _WIN32_WCE
     return APR_ENOTIMPL;
 #else
@@ -96,8 +105,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
 #endif
     sa.lpSecurityDescriptor = NULL;
 
-    (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
-    (*in)->pool = p;
+    (*in) = (apr_file_t *)apr_pcalloc(pool_in, sizeof(apr_file_t));
+    (*in)->pool = pool_in;
     (*in)->fname = NULL;
     (*in)->pipe = 1;
     (*in)->timeout = -1;
@@ -111,8 +120,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
 #if APR_FILES_AS_SOCKETS
     (void) apr_pollset_create(&(*in)->pollset, 1, p, 0);
 #endif
-    (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
-    (*out)->pool = p;
+    (*out) = (apr_file_t *)apr_pcalloc(pool_out, sizeof(apr_file_t));
+    (*out)->pool = pool_out;
     (*out)->fname = NULL;
     (*out)->pipe = 1;
     (*out)->timeout = -1;
@@ -150,7 +159,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
         if (blocking == APR_WRITE_BLOCK /* READ_NONBLOCK */
                || blocking == APR_FULL_NONBLOCK) {
             dwOpenMode |= FILE_FLAG_OVERLAPPED;
-            (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED));
+            (*in)->pOverlapped =
+                    (OVERLAPPED*) apr_pcalloc((*in)->pool, sizeof(OVERLAPPED));
             (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
             (*in)->timeout = 0;
         }
@@ -179,7 +189,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
         if (blocking == APR_READ_BLOCK /* WRITE_NONBLOCK */
                 || blocking == APR_FULL_NONBLOCK) {
             dwOpenMode |= FILE_FLAG_OVERLAPPED;
-            (*out)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED));
+            (*out)->pOverlapped =
+                    (OVERLAPPED*) apr_pcalloc((*out)->pool, sizeof(OVERLAPPED));
             (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
             (*out)->timeout = 0;
         }

Modified: apr/apr/trunk/include/apr_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_file_io.h?rev=1734816&r1=1734815&r2=1734816&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_file_io.h (original)
+++ apr/apr/trunk/include/apr_file_io.h Sun Mar 13 15:09:03 2016
@@ -714,7 +714,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(
  * @bug  Some platforms cannot toggle between blocking and nonblocking,
  * and when passing a pipe as a standard handle to an application which
  * does not expect it, a non-blocking stream will fluxor the client app.
- * @deprecated @see apr_file_pipe_create_ex()
+ * @deprecated @see apr_file_pipe_create_pools()
  */
 APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, 
                                                apr_file_t **out,
@@ -738,6 +738,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
  * does not expect it, a non-blocking stream will fluxor the client app.
  * Use this function rather than apr_file_pipe_create() to create pipes 
  * where one or both ends require non-blocking semantics.
+ * @deprecated @see apr_file_pipe_create_pools()
  */
 APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, 
                                                   apr_file_t **out, 
@@ -745,6 +746,33 @@ APR_DECLARE(apr_status_t) apr_file_pipe_
                                                   apr_pool_t *pool);
 
 /**
+ * Create an anonymous pipe which portably supports async timeout options,
+ * placing each side of the pipe in a different pool.
+ * @param in The newly created pipe's file for reading.
+ * @param out The newly created pipe's file for writing.
+ * @param blocking one of these values defined in apr_thread_proc.h;
+ *                 @li #APR_FULL_BLOCK
+ *                 @li #APR_READ_BLOCK
+ *                 @li #APR_WRITE_BLOCK
+ *                 @li #APR_FULL_NONBLOCK
+ * @param pool_in The pool for the reading pipe.
+ * @param pool_out The pool for the writing pipe.
+ * @remark By default, the returned file descriptors will be inherited
+ * by child processes created using apr_proc_create().  This can be
+ * changed using apr_file_inherit_unset().
+ * @remark Some platforms cannot toggle between blocking and nonblocking,
+ * and when passing a pipe as a standard handle to an application which
+ * does not expect it, a non-blocking stream will fluxor the client app.
+ * Use this function rather than apr_file_pipe_create() to create pipes
+ * where one or both ends require non-blocking semantics.
+ */
+APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in,
+                                                     apr_file_t **out,
+                                                     apr_int32_t blocking,
+                                                     apr_pool_t *pool_in,
+                                                     apr_pool_t *pool_out);
+
+/**
  * Create a named pipe.
  * @param filename The filename of the named pipe
  * @param perm The permissions for the newly created pipe.

Modified: apr/apr/trunk/test/testpipe.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testpipe.c?rev=1734816&r1=1734815&r2=1734816&view=diff
==============================================================================
--- apr/apr/trunk/test/testpipe.c (original)
+++ apr/apr/trunk/test/testpipe.c Sun Mar 13 15:09:03 2016
@@ -56,7 +56,7 @@ static void set_timeout(abts_case *tc, v
     apr_status_t rv;
     apr_interval_time_t timeout;
 
-    rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p);
+    rv = apr_file_pipe_create_pools(&readp, &writep, APR_WRITE_BLOCK, p, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_NOTNULL(tc, readp);
     ABTS_PTR_NOTNULL(tc, writep);
@@ -83,7 +83,7 @@ static void read_write(abts_case *tc, vo
     nbytes = strlen("this is a test");
     buf = (char *)apr_palloc(p, nbytes + 1);
 
-    rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p);
+    rv = apr_file_pipe_create_pools(&readp, &writep, APR_WRITE_BLOCK, p, p);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_PTR_NOTNULL(tc, readp);
     ABTS_PTR_NOTNULL(tc, writep);



Mime
View raw message