Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 59192 invoked from network); 17 Oct 2007 03:17:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Oct 2007 03:17:11 -0000 Received: (qmail 96959 invoked by uid 500); 17 Oct 2007 03:16:58 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 96927 invoked by uid 500); 17 Oct 2007 03:16:58 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 96916 invoked by uid 99); 17 Oct 2007 03:16:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2007 20:16:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 03:17:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F2CB81A9832; Tue, 16 Oct 2007 20:16:40 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r585344 - in /apr/apr/branches/1.2.x: CHANGES configure.in file_io/netware/filestat.c file_io/unix/filestat.c include/arch/unix/apr_arch_file_io.h Date: Wed, 17 Oct 2007 03:16:40 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071017031640.F2CB81A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Tue Oct 16 20:16:38 2007 New Revision: 585344 URL: http://svn.apache.org/viewvc?rev=585344&view=rev Log: Fill in apr_fileinfo_t member st_csize on Netware and Unix And refine the file times down to apr_time_t resolution if supported by a st_atimensec or st_atim.tv_nsec value by the OS. Additional msec implementations are possible if exposed through autoconf. PR: 41678 Authored by: William Rowe, Nicklas Edmundsson Modified: apr/apr/branches/1.2.x/CHANGES apr/apr/branches/1.2.x/configure.in apr/apr/branches/1.2.x/file_io/netware/filestat.c apr/apr/branches/1.2.x/file_io/unix/filestat.c apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h Modified: apr/apr/branches/1.2.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?rev=585344&r1=585343&r2=585344&view=diff ============================================================================== --- apr/apr/branches/1.2.x/CHANGES [utf-8] (original) +++ apr/apr/branches/1.2.x/CHANGES [utf-8] Tue Oct 16 20:16:38 2007 @@ -1,6 +1,12 @@  -*- coding: utf-8 -*- Changes for APR 1.2.12 + *) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678), + and refine the file times down to apr_time_t resolution if supported + by a st_atimensec or st_atim.tv_nsec value by the OS. Additional + msec implementations are possible if exposed through autoconf. + [William Rowe, Nicklas Edmundsson ] + *) Fix apr_socket_recvfrom() to ensure the peer's port and address is returned through the "from" parameter on Unix and Win32. [Joe Orton, William Rowe] Modified: apr/apr/branches/1.2.x/configure.in URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/configure.in?rev=585344&r1=585343&r2=585344&view=diff ============================================================================== --- apr/apr/branches/1.2.x/configure.in (original) +++ apr/apr/branches/1.2.x/configure.in Tue Oct 16 20:16:38 2007 @@ -966,8 +966,6 @@ AC_SUBST(have_memmove) APR_CHECK_SIGWAIT_ONE_ARG -APR_CHECK_DIRENT_INODE -APR_CHECK_DIRENT_TYPE dnl ----------------------------- Checks for Any required Headers AC_HEADER_STDC @@ -1020,6 +1018,7 @@ sys/file.h \ sys/ioctl.h \ sys/mman.h \ + sys/param.h \ sys/poll.h \ sys/resource.h \ sys/select.h \ @@ -1818,6 +1817,24 @@ fi AC_SUBST(rand) + +dnl ----------------------------- Checking for File Info Support +echo "${nl}Checking for File Info Support..." +AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_atimensec, +struct stat.st_ctimensec, struct stat.st_mtimensec, struct stat.st_atim.tv_nsec, +struct stat.st_ctim.tv_nsec, struct stat.st_mtim.tv_nsec],,,[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif]) + +APR_CHECK_DIRENT_INODE +APR_CHECK_DIRENT_TYPE dnl ----------------------------- Checking for UUID Support echo "${nl}Checking for OS UUID Support..." Modified: apr/apr/branches/1.2.x/file_io/netware/filestat.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/file_io/netware/filestat.c?rev=585344&r1=585343&r2=585344&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/netware/filestat.c (original) +++ apr/apr/branches/1.2.x/file_io/netware/filestat.c Tue Oct 16 20:16:38 2007 @@ -58,6 +58,7 @@ { finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; + finfo->protection = apr_unix_mode2perms(info->st_mode); finfo->filetype = filetype_from_mode(info->st_mode); finfo->user = info->st_uid; @@ -66,15 +67,19 @@ finfo->inode = info->st_ino; finfo->device = info->st_dev; finfo->nlink = info->st_nlink; + apr_time_ansi_put(&finfo->atime, info->st_atime.tv_sec); apr_time_ansi_put(&finfo->mtime, info->st_mtime.tv_sec); apr_time_ansi_put(&finfo->ctime, info->st_ctime.tv_sec); - /* ### needs to be revisited - * if (wanted & APR_FINFO_CSIZE) { - * finfo->csize = info->st_blocks * 512; - * finfo->valid |= APR_FINFO_CSIZE; - * } - */ + +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS +#ifdef DEV_BSIZE + finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE; +#else + finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512; +#endif + finfo->valid |= APR_FINFO_CSIZE; +#endif } apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, Modified: apr/apr/branches/1.2.x/file_io/unix/filestat.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/file_io/unix/filestat.c?rev=585344&r1=585343&r2=585344&view=diff ============================================================================== --- apr/apr/branches/1.2.x/file_io/unix/filestat.c (original) +++ apr/apr/branches/1.2.x/file_io/unix/filestat.c Tue Oct 16 20:16:38 2007 @@ -81,14 +81,34 @@ finfo->device = info->st_dev; finfo->nlink = info->st_nlink; apr_time_ansi_put(&finfo->atime, info->st_atime); +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC) + finfo->atime += info->st_atimensec / APR_TIME_C(1000); +#endif + apr_time_ansi_put(&finfo->mtime, info->st_mtime); +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC) + finfo->mtime += info->st_mtimensec / APR_TIME_C(1000); +#endif + apr_time_ansi_put(&finfo->ctime, info->st_ctime); - /* ### needs to be revisited - * if (wanted & APR_FINFO_CSIZE) { - * finfo->csize = info->st_blocks * 512; - * finfo->valid |= APR_FINFO_CSIZE; - * } - */ +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000); +#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC) + finfo->ctime += info->st_ctimensec / APR_TIME_C(1000); +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS +#ifdef DEV_BSIZE + finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE; +#else + finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512; +#endif + finfo->valid |= APR_FINFO_CSIZE; +#endif } apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, Modified: apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h?rev=585344&r1=585343&r2=585344&view=diff ============================================================================== --- apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h (original) +++ apr/apr/branches/1.2.x/include/arch/unix/apr_arch_file_io.h Tue Oct 16 20:16:38 2007 @@ -70,6 +70,10 @@ #ifdef BEOS #include #endif +/* Hunting down DEV_BSIZE if not from dirent.h, sys/stat.h etc */ +#ifdef HAVE_SYS_PARAM_H +#include +#endif #if BEOS_BONE # ifndef BONE7