mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 02:50:17 +01:00
utils: initialize timespec structure
Coverity: Defect type: UNINIT src/NetworkManagerUtils.c:1906: uninit_use_in_call: Using uninitialized value "tp.tv_nsec" when calling "monotonic_timestamp_get". src/NetworkManagerUtils.c:1879: uninit_use_in_call: Using uninitialized value "tp.tv_nsec" when calling "monotonic_timestamp_get". src/NetworkManagerUtils.c:1852: uninit_use_in_call: Using uninitialized value "tp.tv_nsec" when calling "monotonic_timestamp_get". src/NetworkManagerUtils.c:1825: uninit_use_in_call: Using uninitialized value "tp.tv_nsec" when calling "monotonic_timestamp_get".
This commit is contained in:
parent
d80bb52872
commit
7744bd0f85
1 changed files with 4 additions and 4 deletions
|
|
@ -1862,7 +1862,7 @@ monotonic_timestamp_get (struct timespec *tp)
|
|||
gint64
|
||||
nm_utils_get_monotonic_timestamp_ns (void)
|
||||
{
|
||||
struct timespec tp;
|
||||
struct timespec tp = { 0 };
|
||||
|
||||
monotonic_timestamp_get (&tp);
|
||||
|
||||
|
|
@ -1889,7 +1889,7 @@ nm_utils_get_monotonic_timestamp_ns (void)
|
|||
gint64
|
||||
nm_utils_get_monotonic_timestamp_us (void)
|
||||
{
|
||||
struct timespec tp;
|
||||
struct timespec tp = { 0 };
|
||||
|
||||
monotonic_timestamp_get (&tp);
|
||||
|
||||
|
|
@ -1916,7 +1916,7 @@ nm_utils_get_monotonic_timestamp_us (void)
|
|||
gint64
|
||||
nm_utils_get_monotonic_timestamp_ms (void)
|
||||
{
|
||||
struct timespec tp;
|
||||
struct timespec tp = { 0 };
|
||||
|
||||
monotonic_timestamp_get (&tp);
|
||||
|
||||
|
|
@ -1943,7 +1943,7 @@ nm_utils_get_monotonic_timestamp_ms (void)
|
|||
gint32
|
||||
nm_utils_get_monotonic_timestamp_s (void)
|
||||
{
|
||||
struct timespec tp;
|
||||
struct timespec tp = { 0 };
|
||||
|
||||
monotonic_timestamp_get (&tp);
|
||||
return (((gint64) tp.tv_sec) + monotonic_timestamp_offset_sec);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue