apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/file_io/unix filestat.c
Date Thu, 12 Dec 2002 15:41:17 GMT
wrowe       2002/12/12 07:41:16

  Modified:    file_io/unix filestat.c
  Log:
    Since Jeff indicates we trip on FIFO... here should be a legitmiate
    workaround for those platforms without FIFO support.  This is still
    quite a bit simpler for the mainline cases if you look at the extra
    work (discounting the potential benefits of optimizing compilers)
    that happens within the S_ISxxx() macros.
  
  Revision  Changes    Path
  1.59      +16 -0     apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/filestat.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- filestat.c	12 Dec 2002 07:01:51 -0000	1.58
  +++ filestat.c	12 Dec 2002 15:41:16 -0000	1.59
  @@ -73,13 +73,29 @@
           type = APR_CHR;  break;
       case S_IFBLK:
           type = APR_BLK;  break;
  +#if defined(S_IFFIFO)
       case S_IFFIFO:
           type = APR_PIPE; break;
  +#endif
   #if !defined(BEOS) && defined(S_IFSOCK)
       case S_IFSOCK:
           type = APR_SOCK; break;
   #endif
  +
       default:
  +	/* Work around missing S_IFxxx values above
  +         * for Linux et al.
  +         */
  +#if !defined(S_IFFIFO) && defined(S_ISFIFO)
  +    	if (S_ISFIFO(type)) {
  +            type = APR_PIPE;
  +	} else
  +#endif
  +#if !defined(BEOS) && !defined(S_IFSOCK) && defined(S_ISSOCK)
  +    	if (S_ISSOCK(type)) {
  +            type = APR_SOCK;
  +	} else
  +#endif
           type = APR_NOFILE;
       }
       return type;
  
  
  

Mime
View raw message