harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r503372 - in /harmony/enhanced/classlib/trunk/modules: luni/src/main/java/java/io/File.java portlib/src/main/native/port/unix/hyfile.c portlib/src/main/native/port/windows/hyfile.c
Date Sun, 04 Feb 2007 08:15:49 GMT
Author: tellison
Date: Sun Feb  4 00:15:49 2007
New Revision: 503372

URL: http://svn.apache.org/viewvc?view=rev&rev=503372
Log:
Apply patch HARMONY-2236 ([classlib][luni]the return value of File.lastModified() losts its
precision)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfile.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfile.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?view=diff&rev=503372&r1=503371&r2=503372
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java Sun Feb 
4 00:15:49 2007
@@ -780,7 +780,7 @@
         if (result == -1 || result == 0) {
             return 0;
         }
-        return (result * 1000);
+        return result;
     }
 
     private native long lastModifiedImpl(byte[] filePath);

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfile.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfile.c?view=diff&rev=503372&r1=503371&r2=503372
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfile.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfile.c Sun
Feb  4 00:15:49 2007
@@ -486,7 +486,7 @@
 
 #define CDEV_CURRENT_FUNCTION hyfile_lastmod
 /**
- *  Return the last modification time of the file path in seconds.
+ *  Return the last modification time of the file path in milliseconds.
  *
  * @param[in] portLibrary The port library
  * @param[in] path file/path name being queried.
@@ -505,7 +505,7 @@
     {
       return -1;
     }
-  return st.st_mtime;
+  return (U_64)st.st_mtime * 1000;
 }
 
 #undef CDEV_CURRENT_FUNCTION

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfile.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfile.c?view=diff&rev=503372&r1=503371&r2=503372
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfile.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfile.c
Sun Feb  4 00:15:49 2007
@@ -244,7 +244,7 @@
 
 #define CDEV_CURRENT_FUNCTION hyfile_lastmod
 /**
- *  Return the last modification time of the file path in seconds.
+ *  Return the last modification time of the file path in milliseconds.
  *
  * @param[in] portLibrary The port library
  * @param[in] path file/path name being queried.
@@ -276,7 +276,7 @@
      dwHighDateTime << (I_64) 32) | (I_64) myStat.ftLastWriteTime.
     dwLowDateTime;
 
-  result = (tempResult - 116444736000000000) / 10000000;
+  result = (tempResult - 116444736000000000) / 10000;
 
   if (0 == FindClose (newHandle))
     {



Mime
View raw message