rbb         99/11/10 08:47:10

  Modified:    src/lib/apr/file_io/unix fileacc.c pipe.c
  Log:
  Using the filename "PIPE" to determine if an apr_file_t refers to an
  anonymous pipe is a bad idea.  We will now use the stated flag == -1
  for this purpose.  This makes sense because we shouldn't be stat'ing
  anonymous pipes anyway, if this is wrong, it is easy enough to add
  another flag to the file type if we have to, but I would rather not.
  
  Revision  Changes    Path
  1.11      +6 -6      apache-2.0/src/lib/apr/file_io/unix/fileacc.c
  
  Index: fileacc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/fileacc.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- fileacc.c 1999/10/15 14:19:50     1.10
  +++ fileacc.c 1999/11/10 16:47:03     1.11
  @@ -118,7 +118,7 @@
   ap_status_t ap_get_filesize(ap_ssize_t *size, struct file_t *file)
   {
       if (file != NULL) {
  -        if (!file->stated) {
  +        if (file->stated == 0) {
               ap_getfileinfo(file);
           }
           *size = file->size;
  @@ -139,7 +139,7 @@
   ap_status_t ap_get_fileperms(ap_fileperms_t *perm, struct file_t *file)
   {
       if (file != NULL) {
  -        if (!file->stated) {
  +        if (file->stated == 0) {
               ap_getfileinfo(file);
           }
           *perm = file->protection;
  @@ -160,7 +160,7 @@
   ap_status_t ap_get_fileatime(time_t *atime, struct file_t *file)
   {    
       if (file != NULL) {
  -        if (!file->stated) {
  +        if (file->stated == 0) {
               ap_getfileinfo(file);
           }
           *atime = file->atime;
  @@ -181,7 +181,7 @@
   ap_status_t ap_get_filectime(time_t *ptime, struct file_t *file)
   {    
       if (file != NULL) {
  -        if (!file->stated) {
  +        if (file->stated == 0) {
               ap_getfileinfo(file);
           }
           *ptime = file->ctime;
  @@ -202,7 +202,7 @@
   ap_status_t ap_get_filemtime(time_t *mtime, struct file_t *file)
   {    
       if (file != NULL) {
  -        if (!file->stated) {
  +        if (file->stated == 0) {
               ap_getfileinfo(file);
           }
           *mtime = file->mtime;
  @@ -223,7 +223,7 @@
   ap_status_t ap_get_filetype(ap_filetype_e *type, struct file_t *file)
   {    
       if (file != NULL) {
  -        if (!file->stated) {
  +        if (file->stated == 0) {
               ap_getfileinfo(file);
           }
           if (S_ISREG(file->protection))
  
  
  
  1.6       +3 -1      apache-2.0/src/lib/apr/file_io/unix/pipe.c
  
  Index: pipe.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/pipe.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- pipe.c    1999/11/10 15:49:53     1.5
  +++ pipe.c    1999/11/10 16:47:04     1.6
  @@ -93,7 +93,7 @@
    */
   ap_status_t ap_set_pipe_timeout(struct file_t *thepipe, ap_int32_t timeout)
   {
  -    if (!strcmp(thepipe->fname, "PIPE")) {
  +    if (thepipe->stated == -1) {
           thepipe->timeout = timeout;
           return APR_SUCCESS;
       }
  @@ -122,6 +122,7 @@
       (*in)->filedes = filedes[0];
       (*in)->buffered = 0;
       (*in)->fname = ap_pstrdup(cont, "PIPE");
  +    (*in)->stated = -1;
       (*in)->timeout = -1;
   
       (*out) = (struct file_t *)ap_palloc(cont, sizeof(struct file_t));
  @@ -129,6 +130,7 @@
       (*out)->filedes = filedes[1];
       (*out)->buffered = 0;
       (*out)->fname = ap_pstrdup(cont, "PIPE");
  +    (*out)->stated = -1;
       (*out)->timeout = -1;
   
       pipenonblock(*in);
  
  
  

Reply via email to