You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2009/01/12 15:28:28 UTC

svn commit: r733773 - in /apr/apr/trunk: STATUS include/apr_thread_proc.h include/arch/unix/apr_arch_misc.h include/arch/win32/apr_arch_misc.h misc/unix/otherchild.c

Author: jorton
Date: Mon Jan 12 06:28:23 2009
New Revision: 733773

URL: http://svn.apache.org/viewvc?rev=733773&view=rev
Log:
Fix the otherchild API docs to reflect the actual implementation of
the 'write_fd' handling, rather than the implementation which was
removed in 2001.  Also fix the implementation remove pointless bit
shuffling:

* include/arch/win32/apr_arch_misc.h (struct apr_other_child_rec_t),
  include/arch/unix/apr_arch_misc.h (struct apr_other_child_rec_t): 
  Remove unused write_fd field.

* include/apr_thread_proc.h:  Document that APR_OC_REASON_UNWRITABLE is
  unused.
  (apr_proc_other_child_register): Document that the unused write_fd
  parameter is unused.

* misc/unix/otherchild.c (apr_proc_other_child_register): Ignore the
  write_fd parameter rather than copying it then ignoring it.

* STATUS: Move comments on possible future of the write_fd argument
  here.

Modified:
    apr/apr/trunk/STATUS
    apr/apr/trunk/include/apr_thread_proc.h
    apr/apr/trunk/include/arch/unix/apr_arch_misc.h
    apr/apr/trunk/include/arch/win32/apr_arch_misc.h
    apr/apr/trunk/misc/unix/otherchild.c

Modified: apr/apr/trunk/STATUS
URL: http://svn.apache.org/viewvc/apr/apr/trunk/STATUS?rev=733773&r1=733772&r2=733773&view=diff
==============================================================================
--- apr/apr/trunk/STATUS [utf-8] (original)
+++ apr/apr/trunk/STATUS [utf-8] Mon Jan 12 06:28:23 2009
@@ -373,6 +373,14 @@
 
 Interface Changes Postponed for APR 2.0:
 
+    * apr_proc_other_child_register()'s write_fd argument should be removed
+      or made used.  The comment in the API previously said:
+
+         write_fd duplicates the proc->out stream, it's really
+         redundant and should be replaced in the APR 1.0 API with a
+         bitflag of which proc->in/out/err handles should be health
+         checked.  no platform currently tests the pipes health.
+
     * apr_atomic_casptr() has the volatile qualifier in the wrong
       place: should take "pointer to volatile pointer to void", not
       "pointer to pointer to volatile void".

Modified: apr/apr/trunk/include/apr_thread_proc.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_thread_proc.h?rev=733773&r1=733772&r2=733773&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_thread_proc.h (original)
+++ apr/apr/trunk/include/apr_thread_proc.h Mon Jan 12 06:28:23 2009
@@ -113,7 +113,7 @@
  */
 #define APR_OC_REASON_DEATH         0     /**< child has died, caller must call
                                            * unregister still */
-#define APR_OC_REASON_UNWRITABLE    1     /**< write_fd is unwritable */
+#define APR_OC_REASON_UNWRITABLE    1     /**< currently unused. */
 #define APR_OC_REASON_RESTART       2     /**< a restart is occuring, perform
                                            * any necessary cleanup (including
                                            * sending a special signal to child)
@@ -693,14 +693,9 @@
  * @param maintenance maintenance is a function that is invoked with a 
  *                    reason and the data pointer passed here.
  * @param data Opaque context data passed to the maintenance function.
- * @param write_fd An fd that is probed for writing.  If it is ever unwritable
- *                 then the maintenance is invoked with reason 
- *                 OC_REASON_UNWRITABLE.
+ * @param write_fd This argument is currently unused and should be passed 
+ *                 as NULL.
  * @param p The pool to use for allocating memory.
- * @bug write_fd duplicates the proc->out stream, it's really redundant
- * and should be replaced in the APR 1.0 API with a bitflag of which
- * proc->in/out/err handles should be health checked.
- * @bug no platform currently tests the pipes health.
  */
 APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, 
                                            void (*maintenance) (int reason, 

Modified: apr/apr/trunk/include/arch/unix/apr_arch_misc.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/unix/apr_arch_misc.h?rev=733773&r1=733772&r2=733773&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/unix/apr_arch_misc.h (original)
+++ apr/apr/trunk/include/arch/unix/apr_arch_misc.h Mon Jan 12 06:28:23 2009
@@ -55,7 +55,6 @@
     apr_proc_t *proc;
     void (*maintenance) (int, void *, int);
     void *data;
-    apr_os_file_t write_fd;
 };
 
 #if defined(WIN32) || defined(NETWARE)

Modified: apr/apr/trunk/include/arch/win32/apr_arch_misc.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/win32/apr_arch_misc.h?rev=733773&r1=733772&r2=733773&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/win32/apr_arch_misc.h (original)
+++ apr/apr/trunk/include/arch/win32/apr_arch_misc.h Mon Jan 12 06:28:23 2009
@@ -52,7 +52,6 @@
     apr_proc_t *proc;
     void (*maintenance) (int, void *, int);
     void *data;
-    apr_os_file_t write_fd;
 };
 
 #define WSAHighByte 2

Modified: apr/apr/trunk/misc/unix/otherchild.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/unix/otherchild.c?rev=733773&r1=733772&r2=733773&view=diff
==============================================================================
--- apr/apr/trunk/misc/unix/otherchild.c (original)
+++ apr/apr/trunk/misc/unix/otherchild.c Mon Jan 12 06:28:23 2009
@@ -63,20 +63,6 @@
     ocr->proc = proc;
     ocr->maintenance = maintenance;
     ocr->data = data;
-    if (write_fd == NULL) {
-        ocr->write_fd = (apr_os_file_t) -1;
-    }
-    else {
-#ifdef WIN32
-        /* This should either go away as part of eliminating apr_proc_probe_writable_fds
-         * or write_fd should point to an apr_file_t
-         */
-        ocr->write_fd = write_fd->filehand; 
-#else
-        ocr->write_fd = write_fd->filedes;
-#endif
-
-    }
     ocr->next = other_children;
     other_children = ocr;
     apr_pool_cleanup_register(p, ocr->data, other_child_cleanup,