Re: cvs commit: apr/file_io/unix filestat.c

2002-12-12 Thread Jeff Trawick
[EMAIL PROTECTED] writes:

 wrowe   2002/12/11 23:01:52
 
   Modified:file_io/unix filestat.c
   Log:
 switch {case} and default: are probably better for handling this case.
 Is anyone aware of a platform where S_IFxxx # isn't available, yet
 S_ISxxx(#) is?

RH Linux 7.3 doesn't have S_IFFIFO

-- 
Jeff Trawick | [EMAIL PROTECTED]
Born in Roswell... married an alien...


Re: cvs commit: apr/file_io/unix filestat.c

2002-12-12 Thread William A. Rowe, Jr.
At 06:49 AM 12/12/2002, Jeff Trawick wrote:
[EMAIL PROTECTED] writes:

 wrowe   2002/12/11 23:01:52
 
   Modified:file_io/unix filestat.c
   Log:
 switch {case} and default: are probably better for handling this case.
 Is anyone aware of a platform where S_IFxxx # isn't available, yet
 S_ISxxx(#) is?

RH Linux 7.3 doesn't have S_IFFIFO

Yet it does have S_ISFIFO?

Bill



Re: cvs commit: apr/file_io/unix filestat.c

2002-12-12 Thread Jeff Trawick
William A. Rowe, Jr. [EMAIL PROTECTED] writes:

 At 06:49 AM 12/12/2002, Jeff Trawick wrote:
 [EMAIL PROTECTED] writes:
 
  wrowe   2002/12/11 23:01:52
  
Modified:file_io/unix filestat.c
Log:
  switch {case} and default: are probably better for handling this case.
  Is anyone aware of a platform where S_IFxxx # isn't available, yet
  S_ISxxx(#) is?
 
 RH Linux 7.3 doesn't have S_IFFIFO
 
 Yet it does have S_ISFIFO?

of course, the old code compiled fine everywhere

AIX and Tru64 have reported back by now...  broken build there for the
same reason...

-- 
Jeff Trawick | [EMAIL PROTECTED]
Born in Roswell... married an alien...


Re: cvs commit: apr/file_io/unix filestat.c

2002-12-12 Thread Branko ibej
William A. Rowe, Jr. wrote:

At 06:49 AM 12/12/2002, Jeff Trawick wrote:
  

[EMAIL PROTECTED] writes:



wrowe   2002/12/11 23:01:52

  Modified:file_io/unix filestat.c
  Log:
switch {case} and default: are probably better for handling this case.
Is anyone aware of a platform where S_IFxxx # isn't available, yet
S_ISxxx(#) is?
  

RH Linux 7.3 doesn't have S_IFFIFO



Yet it does have S_ISFIFO?

Bill


The funny thing about this change is that, for a short switch like that,
many modern compilers just convert it to a series of if ... else if
tests. So just putting the elses in there wouldn've been better -- not
to mention more correct. I don't think generating a jump table for just
seven cases makes sense on any platform.

-- 
Brane ibej   [EMAIL PROTECTED]   http://www.xbc.nu/brane/



Re: cvs commit: apr/file_io/unix filestat.c

2002-12-12 Thread William A. Rowe, Jr.
At 09:28 AM 12/12/2002, Brane wrote:
William A. Rowe, Jr. wrote:

At 06:49 AM 12/12/2002, Jeff Trawick wrote:
  

[EMAIL PROTECTED] writes:



wrowe   2002/12/11 23:01:52

  Modified:file_io/unix filestat.c
  Log:
switch {case} and default: are probably better for handling this case.
Is anyone aware of a platform where S_IFxxx # isn't available, yet
S_ISxxx(#) is?
  

RH Linux 7.3 doesn't have S_IFFIFO

Yet it does have S_ISFIFO?

The funny thing about this change is that, for a short switch like that,
many modern compilers just convert it to a series of if ... else if
tests. So just putting the elses in there wouldn've been better -- not
to mention more correct. I don't think generating a jump table for just
seven cases makes sense on any platform.

While I agree with you if the tests...

if (i == S_IFxxx)  if (S_IFxxx(i))

were identical, they aren't.  This change still gains us the potential benefit
(possibly optimized away) of not remasking the type from the mode repeatedly.

I've worked around missing S_IFFIFO and S_IFSOCK.  If there are others
on other odd platforms, I'll surrender, revert the patch and add the missing
else-es (in the better order they are given now; reg, dir, lnk etc.)

Bill





Re: cvs commit: apr/file_io/unix filestat.c

2002-10-11 Thread William A. Rowe, Jr.
I lie.  This patch didn't change a thing.

The latest HP/UX security patches cause detection of dlopen(), while
older builds only have shl support.  This causes nightmares for bin
builds on HPUX11.

It seems we should check shl prior to dlopen(), since shl would be the
defacto standard on HPUX or platforms that implement it, no?

Attached is the patch for consideration... I'll apply on Monday if noone
yells loudly.

Bill

At 01:31 PM 10/7/2002, William A. Rowe, Jr. wrote:
This patch borked DSO_USE_SHL detection for HP/UX.

Ideas?

Bill

At 02:26 PM 9/22/2002, [EMAIL PROTECTED] wrote:
brianp  2002/09/22 12:26:42

  Modified:.CHANGES configure.in
   buildapr_hints.m4
   file_io/unix filestat.c
  Log:
  Added support for SCO OpenServer 5
  Submitted by: Kean Johnston [EMAIL PROTECTED]
  Reviewed by:  Brian Pane
  1.483 +6 -4  apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.482
  retrieving revision 1.483
  diff -u -r1.482 -r1.483
  --- configure.in  20 Sep 2002 10:42:37 -  1.482
  +++ configure.in  22 Sep 2002 19:26:41 -  1.483
  @@ -1173,7 +1173,9 @@
   
   APR_CHECK_SIZEOF_EXTENDED([#include sys/types.h], pid_t, 8)
   
  -if test $ac_cv_sizeof_pid_t = $ac_cv_sizeof_int; then
  +if test $ac_cv_sizeof_pid_t = $ac_cv_sizeof_short; then
  +pid_t_fmt='#define APR_PID_T_FMT hd'
  +elif test $ac_cv_sizeof_pid_t = $ac_cv_sizeof_int; then
   pid_t_fmt='#define APR_PID_T_FMT d'
   elif test $ac_cv_sizeof_pid_t = $ac_cv_sizeof_long; then
   pid_t_fmt='#define APR_PID_T_FMT ld'
  @@ -1265,11 +1267,11 @@
 [ 
   AC_CHECK_FUNCS(NSLinkModule, [ tempdso=dyld ], [ tempdso=no ])
   if test $tempdso = no; then
  -  AC_CHECK_LIB(dl, dlopen, [ tempdso=dlfcn APR_ADDTO(LIBS,-ldl) ], 
  -   tempdso=no)
  +  AC_CHECK_FUNCS(dlopen, [ tempdso=dlfcn ], [ tempdso=no ])
   fi
   if test $tempdso = no; then
  -  AC_CHECK_FUNCS(dlopen, [ tempdso=dlfcn ], [ tempdso=no ])
  +  AC_CHECK_LIB(dl, dlopen, [ tempdso=dlfcn APR_ADDTO(LIBS,-ldl) ], 
  +   tempdso=no)
   fi
   if test $tempdso = no; then
 AC_CHECK_LIB(root, load_image, tempdso=yes, tempdso=no)
  
  
  
  1.44  +3 -3  apr/build/apr_hints.m4
  
  Index: apr_hints.m4
  ===
  RCS file: /home/cvs/apr/build/apr_hints.m4,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- apr_hints.m4  9 May 2002 23:27:20 -   1.43
  +++ apr_hints.m4  22 Sep 2002 19:26:41 -  1.44
  @@ -173,14 +173,14 @@
APR_ADDTO(LDFLAGS, [-posix])
APR_ADDTO(LIBS, [-linet])
;;
  -*-sco3*)
  +*-sco3.2v[234]*)
APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
APR_ADDTO(CFLAGS, [-Oacgiltz])
APR_ADDTO(LIBS, [-lPW -lmalloc _i])
;;
  -*-sco5*)
  +*-sco3.2v5*)
APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT])
  - APR_ADDTO(LIBS, [-lmalloc -lprot -ltinfo -lx])
  + APR_ADDTO(LIBS, [-lprot])
;;
   *-sco_sv*|*-SCO_SV*)
APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
  
  
  
  1.57  +1 -1  apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===
  RCS file: /home/cvs/apr/file_io/unix/filestat.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- filestat.c1 Jul 2002 14:04:58 -   1.56
  +++ filestat.c22 Sep 2002 19:26:41 -  1.57
  @@ -74,7 +74,7 @@
   type = APR_PIPE;
   if (S_ISLNK(mode))
   type = APR_LNK;
  -#ifndef BEOS
  +#if !defined(BEOS)  defined(S_ISSOCK)
   if (S_ISSOCK(mode))
   type = APR_SOCK;
   #endif

Index: configure.in
===
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.484
diff -u -r1.484 configure.in
--- configure.in3 Oct 2002 15:31:49 -   1.484
+++ configure.in10 Oct 2002 23:09:42 -
@@ -1267,6 +1267,10 @@
   [ 
 AC_CHECK_FUNCS(NSLinkModule, [ tempdso=dyld ], [ tempdso=no ])
 if test $tempdso = no; then
+  AC_CHECK_LIB(dld, shl_load, [ tempdso=shl APR_ADDTO(LIBS,-ldld) ],
+   tempdso=no)
+fi
+if test $tempdso = no; then
   AC_CHECK_FUNCS(dlopen, [ tempdso=dlfcn ], [ tempdso=no ])
 fi
 if test $tempdso = no; then
@@ -1275,10 +1279,6 @@
 fi
 if test $tempdso = no; then
   AC_CHECK_LIB(root, load_image, tempdso=yes, tempdso=no)
-fi
-if test $tempdso = no; then
-  AC_CHECK_LIB(dld, shl_load, [ tempdso=shl APR_ADDTO(LIBS,-ldld) ],
-   tempdso=no)
 fi
 if test $tempdso = no; then
 case $host in


Re: cvs commit: apr/file_io/unix filestat.c

2001-01-24 Thread William A. Rowe, Jr.
 trawick 01/01/24 13:11:52
 
   Modified:file_io/unix filestat.c
   Log:
   get filestat.c to compile again

and it rides again, I presume?  Thanks Jeff



Re: cvs commit: apr/file_io/unix filestat.c

2001-01-24 Thread Jeff Trawick
William A. Rowe, Jr. [EMAIL PROTECTED] writes:

  trawick 01/01/24 13:11:52
  
Modified:file_io/unix filestat.c
Log:
get filestat.c to compile again
 
 and it rides again, I presume?  Thanks Jeff

autoindex is still failing for me; I'll play with it some more

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


Re: cvs commit: apr/file_io/unix filestat.c

2001-01-24 Thread William A. Rowe, Jr.
That's odd - it works flawlessly for me.

The bug's gotta be in apr_stat, since I mod_autoindex looks at nothing
but the filename and creates the subrequest to parse each file entry.
Hmmm... could be the apr_lstat variety, better be sure we clear that
flag out.  I'm thinking that -valid |= APR_FINFO_STAT should tell the
user we did an lstat() instead of a stat(), and leave the APR_LNK flag 
to tell them that it was (or wasn't) a link.

Maybe that's the bit that's fooling us all.

Bill

- Original Message - 
From: Jeff Trawick [EMAIL PROTECTED]
To: William A. Rowe, Jr. [EMAIL PROTECTED]
Cc: dev@apr.apache.org
Sent: Wednesday, January 24, 2001 4:01 PM
Subject: Re: cvs commit: apr/file_io/unix filestat.c


 William A. Rowe, Jr. [EMAIL PROTECTED] writes:
 
   trawick 01/01/24 13:11:52
   
 Modified:file_io/unix filestat.c
 Log:
 get filestat.c to compile again
  
  and it rides again, I presume?  Thanks Jeff
 
 autoindex is still failing for me; I'll play with it some more
 
 -- 
 Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
  Born in Roswell... married an alien...