Changeset 5338

Show
Ignore:
Timestamp:
03/01/08 07:57:25 (4 months ago)
Author:
morris
Message:

Check for struct stat64.st_birthtime

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/config.h.in

    r5332 r5338  
    131131#undef HAVE_STRUCT_SOCKADDR_SA_LEN 
    132132 
     133/* Define to 1 if `st_birthtime' is member of `struct stat64'. */ 
     134#undef HAVE_STRUCT_STAT64_ST_BIRTHTIME 
     135 
    133136/* Define to 1 if `st_birthtime' is member of `struct stat'. */ 
    134137#undef HAVE_STRUCT_STAT_ST_BIRTHTIME 
  • libwired/trunk/configure

    r5332 r5338  
    85058505 
    85068506        #include <sys/types.h> 
     8507        #include <sys/stat.h> 
    85078508 
    85088509 
     
    85478548 
    85488549        #include <sys/types.h> 
     8550        #include <sys/stat.h> 
    85498551 
    85508552 
     
    85958597cat >>confdefs.h <<_ACEOF 
    85968598#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 
     8599_ACEOF 
     8600 
     8601 
     8602fi 
     8603{ echo "$as_me:$LINENO: checking for struct stat64.st_birthtime" >&5 
     8604echo $ECHO_N "checking for struct stat64.st_birthtime... $ECHO_C" >&6; } 
     8605if test "${ac_cv_member_struct_stat64_st_birthtime+set}" = set; then 
     8606  echo $ECHO_N "(cached) $ECHO_C" >&6 
     8607else 
     8608  cat >conftest.$ac_ext <<_ACEOF 
     8609/* confdefs.h.  */ 
     8610_ACEOF 
     8611cat confdefs.h >>conftest.$ac_ext 
     8612cat >>conftest.$ac_ext <<_ACEOF 
     8613/* end confdefs.h.  */ 
     8614 
     8615        #include <sys/types.h> 
     8616        #include <sys/stat.h> 
     8617 
     8618 
     8619int 
     8620main () 
     8621{ 
     8622static struct stat64 ac_aggr; 
     8623if (ac_aggr.st_birthtime) 
     8624return 0; 
     8625  ; 
     8626  return 0; 
     8627} 
     8628_ACEOF 
     8629rm -f conftest.$ac_objext 
     8630if { (ac_try="$ac_compile" 
     8631case "(($ac_try" in 
     8632  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     8633  *) ac_try_echo=$ac_try;; 
     8634esac 
     8635eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     8636  (eval "$ac_compile") 2>conftest.er1 
     8637  ac_status=$? 
     8638  grep -v '^ *+' conftest.er1 >conftest.err 
     8639  rm -f conftest.er1 
     8640  cat conftest.err >&5 
     8641  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8642  (exit $ac_status); } && { 
     8643         test -z "$ac_c_werror_flag" || 
     8644         test ! -s conftest.err 
     8645       } && test -s conftest.$ac_objext; then 
     8646  ac_cv_member_struct_stat64_st_birthtime=yes 
     8647else 
     8648  echo "$as_me: failed program was:" >&5 
     8649sed 's/^/| /' conftest.$ac_ext >&5 
     8650 
     8651        cat >conftest.$ac_ext <<_ACEOF 
     8652/* confdefs.h.  */ 
     8653_ACEOF 
     8654cat confdefs.h >>conftest.$ac_ext 
     8655cat >>conftest.$ac_ext <<_ACEOF 
     8656/* end confdefs.h.  */ 
     8657 
     8658        #include <sys/types.h> 
     8659        #include <sys/stat.h> 
     8660 
     8661 
     8662int 
     8663main () 
     8664{ 
     8665static struct stat64 ac_aggr; 
     8666if (sizeof ac_aggr.st_birthtime) 
     8667return 0; 
     8668  ; 
     8669  return 0; 
     8670} 
     8671_ACEOF 
     8672rm -f conftest.$ac_objext 
     8673if { (ac_try="$ac_compile" 
     8674case "(($ac_try" in 
     8675  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     8676  *) ac_try_echo=$ac_try;; 
     8677esac 
     8678eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     8679  (eval "$ac_compile") 2>conftest.er1 
     8680  ac_status=$? 
     8681  grep -v '^ *+' conftest.er1 >conftest.err 
     8682  rm -f conftest.er1 
     8683  cat conftest.err >&5 
     8684  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8685  (exit $ac_status); } && { 
     8686         test -z "$ac_c_werror_flag" || 
     8687         test ! -s conftest.err 
     8688       } && test -s conftest.$ac_objext; then 
     8689  ac_cv_member_struct_stat64_st_birthtime=yes 
     8690else 
     8691  echo "$as_me: failed program was:" >&5 
     8692sed 's/^/| /' conftest.$ac_ext >&5 
     8693 
     8694        ac_cv_member_struct_stat64_st_birthtime=no 
     8695fi 
     8696 
     8697rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8698fi 
     8699 
     8700rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8701fi 
     8702{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat64_st_birthtime" >&5 
     8703echo "${ECHO_T}$ac_cv_member_struct_stat64_st_birthtime" >&6; } 
     8704if test $ac_cv_member_struct_stat64_st_birthtime = yes; then 
     8705 
     8706cat >>confdefs.h <<_ACEOF 
     8707#define HAVE_STRUCT_STAT64_ST_BIRTHTIME 1 
    85978708_ACEOF 
    85988709 
  • libwired/trunk/configure.in

    r5332 r5338  
    199199 
    200200# Check if stat struct has st_birthtime member 
    201 AC_CHECK_MEMBERS([struct stat.st_birthtime], [], [], [ 
     201AC_CHECK_MEMBERS([struct stat.st_birthtime, struct stat64.st_birthtime], [], [], [ 
    202202        #include <sys/types.h> 
     203        #include <sys/stat.h> 
    203204]) 
    204205 
  • libwired/trunk/libwired/file/wi-file.c

    r5328 r5338  
    426426        sp->mtime               = sb.st_mtime; 
    427427        sp->ctime               = sb.st_ctime; 
     428 
     429#ifdef HAVE_STRUCT_STAT64_ST_BIRTHTIME 
    428430        sp->birthtime   = sb.st_birthtime; 
     431#else 
     432        sp->birthtime   = sb.st_ctime; 
     433#endif 
     434         
    429435        sp->size                = sb.st_size; 
    430436        sp->blocks              = sb.st_blocks;