summaryrefslogtreecommitdiff
path: root/tests/random.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
commit5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch)
tree056a4477fd870d454d5be5868cddab829a47f4d2 /tests/random.c
parent27dae84ed92f1ef0300263091972338d12e78348 (diff)
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'tests/random.c')
-rw-r--r--tests/random.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/random.c b/tests/random.c
index e0d4b07a..4e3676d9 100644
--- a/tests/random.c
+++ b/tests/random.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -246,14 +246,11 @@ weak_alias (__srandom, srand)
char *
__initstate (unsigned int seed, char *arg_state, size_t n)
{
- int32_t *ostate;
- int ret;
-
__libc_lock_lock (lock);
- ostate = &unsafe_state.state[-1];
+ int32_t *ostate = &unsafe_state.state[-1];
- ret = __initstate_r (seed, arg_state, n, &unsafe_state);
+ int ret = __initstate_r (seed, arg_state, n, &unsafe_state);
__libc_lock_unlock (lock);
@@ -273,11 +270,9 @@ weak_alias (__initstate, initstate)
char *
__setstate (char *arg_state)
{
- int32_t *ostate;
-
__libc_lock_lock (lock);
- ostate = &unsafe_state.state[-1];
+ int32_t *ostate = &unsafe_state.state[-1];
if (__setstate_r (arg_state, &unsafe_state) < 0)
ostate = NULL;
@@ -303,10 +298,9 @@ weak_alias (__setstate, setstate)
long int
__random (void)
{
- int32_t retval;
-
__libc_lock_lock (lock);
+ int32_t retval;
(void) __random_r (&unsafe_state, &retval);
__libc_lock_unlock (lock);