java plugin: Divide times received from Java by 1000.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 18 Feb 2009 22:39:57 +0000 (23:39 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 18 Feb 2009 22:39:57 +0000 (23:39 +0100)
Java keeps time as milliseconds in 64bit integers. Let's keep it that
way and translate to epoch transparently.

The other way around, from C to Java, already multiplies by 1000.

src/java.c

index 2d4974f..488e18b 100644 (file)
@@ -1078,7 +1078,8 @@ static int jtoc_value_list (JNIEnv *jvm_env, value_list_t *vl, /* {{{ */
     ERROR ("java plugin: jtoc_value_list: jtoc_long (getTime) failed.");
     return (-1);
   }
-  vl->time = (time_t) tmp_long;
+  /* Java measures time in milliseconds. */
+  vl->time = (time_t) (tmp_long / ((jlong) 1000));
 
   status = jtoc_long (jvm_env, &tmp_long,
       class_ptr, object_ptr, "getInterval");