apr_pipe_create() sets apr_file_t->fname to

  apr_pstrdup(p, "PIPE")

  (why not just "PIPE")

or   

  "\0" 

  (why not just "")

or

  ""

depending on the function.

Why not leave it NULL?  I don't see any code to retrieve it.
Presumably if somebody is looking at the structure in memory they'll
realize that NULL is okay since it is a pipe.

OS/2 seems to have a valid name so that code is unaffected.

Index: file_io/unix/pipe.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/unix/pipe.c,v
retrieving revision 1.46
diff -u -r1.46 pipe.c
--- file_io/unix/pipe.c 2001/02/16 04:15:37     1.46
+++ file_io/unix/pipe.c 2001/07/23 16:23:11
@@ -166,7 +166,7 @@
     (*in)->cntxt = cont;
     (*in)->filedes = filedes[0];
     (*in)->pipe = 1;
-    (*in)->fname = apr_pstrdup(cont, "PIPE");
+    (*in)->fname = NULL;
     (*in)->buffered = 0;
     (*in)->blocking = BLK_ON;
     (*in)->timeout = -1;
@@ -179,7 +179,7 @@
     (*out)->cntxt = cont;
     (*out)->filedes = filedes[1];
     (*out)->pipe = 1;
-    (*out)->fname = apr_pstrdup(cont, "PIPE");
+    (*out)->fname = NULL;
     (*out)->buffered = 0;
     (*out)->blocking = BLK_ON;
     (*out)->timeout = -1;
Index: file_io/win32/pipe.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/pipe.c,v
retrieving revision 1.37
diff -u -r1.37 pipe.c
--- file_io/win32/pipe.c        2001/06/06 16:04:54     1.37
+++ file_io/win32/pipe.c        2001/07/23 16:23:11
@@ -91,7 +91,7 @@
 
     (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
     (*in)->cntxt = p;
-    (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */
+    (*in)->fname = NULL;
     (*in)->pipe = 1;
     (*in)->timeout = -1;
     (*in)->ungetchar = -1;
@@ -103,7 +103,7 @@
 
     (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
     (*out)->cntxt = p;
-    (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */
+    (*in)->fname = NULL;
     (*out)->pipe = 1;
     (*out)->timeout = -1;
     (*out)->ungetchar = -1;
@@ -161,7 +161,7 @@
 
     (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
     (*in)->cntxt = p;
-    (*in)->fname = ""; // What was this??? : apr_pstrdup(p, "PIPE"); */
+    (*in)->fname = NULL;
     (*in)->pipe = 1;
     (*in)->timeout = -1;
     (*in)->ungetchar = -1;
@@ -174,7 +174,7 @@
 
     (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
     (*out)->cntxt = p;
-    (*out)->fname = ""; // What was this??? : apr_pstrdup(p, "PIPE"); */
+    (*out)->fname = NULL;
     (*out)->pipe = 1;
     (*out)->timeout = -1;
     (*out)->ungetchar = -1;

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Reply via email to