From a6e2a329a07c71582ac696809fb5349c6a0b681c Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Mon, 1 Sep 2025 06:48:48 +0000 Subject: [PATCH] 8366092: [GCC static analyzer] UnixOperatingSystem.c warning: use of uninitialized value 'systemTicks' Reviewed-by: kevinw, asteiner --- .../linux/native/libmanagement_ext/UnixOperatingSystem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c b/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c index af7d52424b7..326dd916f7e 100644 --- a/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c +++ b/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -195,7 +195,7 @@ static int get_jvmticks(ticks *pticks) { uint64_t userTicks; uint64_t systemTicks; - if (read_ticks("/proc/self/stat", &userTicks, &systemTicks) < 0) { + if (read_ticks("/proc/self/stat", &userTicks, &systemTicks) != 2) { return -1; }