summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 946b7d53f9..e615195af5 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3011,7 +3011,8 @@ unsigned long long random_ull(void) {
uint64_t ull;
ssize_t r;
- if ((fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY)) < 0)
+ fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY);
+ if (fd < 0)
goto fallback;
r = loop_read(fd, &ull, sizeof(ull), true);