From commits-return-6873-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Sat Jul 16 08:11:04 2005 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 84787 invoked from network); 16 Jul 2005 08:11:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jul 2005 08:11:04 -0000 Received: (qmail 79504 invoked by uid 500); 16 Jul 2005 08:11:04 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 79405 invoked by uid 500); 16 Jul 2005 08:11:03 -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 79392 invoked by uid 99); 16 Jul 2005 08:11:03 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 16 Jul 2005 01:10:52 -0700 Received: (qmail 84769 invoked by uid 65534); 16 Jul 2005 08:10:50 -0000 Message-ID: <20050716081050.84768.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r219296 - in /apr/apr/branches/1.1.x: file_io/os2/filestat.c include/arch/os2/apr_arch_file_io.h time/unix/time.c Date: Sat, 16 Jul 2005 08:10:50 -0000 To: commits@apr.apache.org From: bjh@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: bjh Date: Sat Jul 16 01:10:49 2005 New Revision: 219296 URL: http://svn.apache.org/viewcvs?rev=219296&view=rev Log: OS/2: Implement apr_file_mtime_set(). Backport from trunk of r219295. Modified: apr/apr/branches/1.1.x/file_io/os2/filestat.c apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h apr/apr/branches/1.1.x/time/unix/time.c Modified: apr/apr/branches/1.1.x/file_io/os2/filestat.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/file_io/os2/filestat.c?rev=219296&r1=219295&r2=219296&view=diff ============================================================================== --- apr/apr/branches/1.1.x/file_io/os2/filestat.c (original) +++ apr/apr/branches/1.1.x/file_io/os2/filestat.c Sat Jul 16 01:10:49 2005 @@ -225,5 +225,16 @@ apr_time_t mtime, apr_pool_t *pool) { - return APR_ENOTIMPL; + FILESTATUS3 fs3; + ULONG rc; + rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3)); + + if (rc) { + return APR_FROM_OS_ERROR(rc); + } + + apr_apr_time_to_os2_time(&fs3.fdateLastWrite, &fs3.ftimeLastWrite, mtime); + + rc = DosSetPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3), 0); + return APR_FROM_OS_ERROR(rc); } Modified: apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h?rev=219296&r1=219295&r2=219296&view=diff ============================================================================== --- apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h (original) +++ apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h Sat Jul 16 01:10:49 2005 @@ -66,6 +66,8 @@ apr_status_t apr_file_cleanup(void *); apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time, + apr_time_t aprtime); /* see win32/fileio.h for description of these */ extern const char c_is_fnchar[256]; Modified: apr/apr/branches/1.1.x/time/unix/time.c URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/time/unix/time.c?rev=219296&r1=219295&r2=219296&view=diff ============================================================================== --- apr/apr/branches/1.1.x/time/unix/time.c (original) +++ apr/apr/branches/1.1.x/time/unix/time.c Sat Jul 16 01:10:49 2005 @@ -266,6 +266,23 @@ *result = mktime(&tmpdate) * APR_USEC_PER_SEC; return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_apr_time_to_os2_time(FDATE *os2date, + FTIME *os2time, + apr_time_t aprtime) +{ + time_t ansitime = aprtime / APR_USEC_PER_SEC; + struct tm *lt; + lt = localtime(&ansitime); + os2time->hours = lt->tm_hour; + os2time->minutes = lt->tm_min; + os2time->twosecs = lt->tm_sec / 2; + + os2date->day = lt->tm_mday; + os2date->month = lt->tm_mon + 1; + os2date->year = lt->tm_year - 80; + return APR_SUCCESS; +} #endif #ifdef NETWARE