]> granicus.if.org Git - apache/commitdiff
Fixed Lua r:stat() time values.
authorGuenter Knauf <fuankg@apache.org>
Thu, 11 Apr 2013 00:19:30 +0000 (00:19 +0000)
committerGuenter Knauf <fuankg@apache.org>
Thu, 11 Apr 2013 00:19:30 +0000 (00:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1466743 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_request.c

index e1a417d5d8552b91c2dca890bbb2546b63e2fd24..bf7220e499e5b8c4a1cf90bc8fd39a5fb5efef95 100644 (file)
@@ -1208,23 +1208,23 @@ static int lua_ap_stat(lua_State *L)
         lua_newtable(L);
 
         lua_pushstring(L, "mtime");
-        lua_pushinteger(L, file_info.mtime);
+        lua_pushinteger(L, (ptrdiff_t)(file_info.mtime / 1000000));
         lua_settable(L, -3);
 
         lua_pushstring(L, "atime");
-        lua_pushinteger(L, file_info.atime);
+        lua_pushinteger(L, (ptrdiff_t)(file_info.atime / 1000000));
         lua_settable(L, -3);
 
         lua_pushstring(L, "ctime");
-        lua_pushinteger(L, file_info.ctime);
+        lua_pushinteger(L, (ptrdiff_t)(file_info.ctime / 1000000));
         lua_settable(L, -3);
 
         lua_pushstring(L, "size");
-        lua_pushinteger(L, file_info.size);
+        lua_pushinteger(L, (ptrdiff_t)file_info.size);
         lua_settable(L, -3);
 
         lua_pushstring(L, "filetype");
-        lua_pushinteger(L, file_info.filetype);
+        lua_pushinteger(L, (ptrdiff_t)file_info.filetype);
         lua_settable(L, -3);
 
         return 1;