mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-26 12:00:48 -09:00
support/testing: TestOpenJdk: remove stime() function call
stime() has been deprecated in glibc 2.31 [1] and replaced with clock_settime(). Let's replace the stime() function call used in BR2_PACKAGE_OPENJDK_JNI_TEST sources with clock_settime(). Apply the same change as busybox [2]. Make sure that timeToSet has been zeroed. With that fixed, the test "Call Native Library to Set System Time" succeed: [BRTEST# java -cp /usr/bin JniTest Test: Get JNI Version passed Test: Read Native String Constant passed Test: Write Java String to Native Library passed Test: Write Java Char Array to Native Library passed Test: Write String Member to Native Library passed Test: Set String Member from Native Library passed Test: Execeute Java Function from Native Library passed Test: Instantiate Java Class passed Test: Call Native Library to Set System Time passed [BRTEST# echo $? 0 The last external toolchain using a glibc 2.30 was the Bootlin aarch64--glibc--bleeding-edge-2020.02-2, so since then TestOpenJdk is broken. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/11176774851 [1] https://lists.gnu.org/archive/html/info-gnu/2020-02/msg00001.html [2] https://git.busybox.net/busybox/commit/?id=d3539be8f27b8cbfdfee460fe08299158f08bcd9 [3] https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/readmes/aarch64--glibc--bleeding-edge-2020.02-2.txt Signed-off-by: Romain Naour <romain.naour@smile.fr> Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
committed by
Julien Olivain
parent
dac94834cc
commit
681b92664d
@@ -29,8 +29,10 @@ void execute_function(void(*function)(void*), void* context)
|
||||
}
|
||||
void set_time_in_seconds(int seconds)
|
||||
{
|
||||
time_t timeToSet = seconds;
|
||||
stime(&timeToSet);
|
||||
struct timespec timeToSet = { 0, 0 };
|
||||
|
||||
timeToSet.tv_sec = seconds;
|
||||
clock_settime(CLOCK_REALTIME, &timeToSet);
|
||||
}
|
||||
void write_internal_time_in_seconds()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user