summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 13c1ca1)
raw | patch | inline | side by side (parent: 13c1ca1)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 4 Jun 2016 18:07:08 +0000 (20:07 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 4 Jun 2016 18:07:08 +0000 (20:07 +0200) |
chrony.c:745:11: warning: declaration shadows a local variable
[-Wshadow]
int fh = open("/dev/random", 00);
^
[-Wshadow]
int fh = open("/dev/random", 00);
^
src/chrony.c | patch | blob | history |
diff --git a/src/chrony.c b/src/chrony.c
index 4554f4990e36183e6e45eab3ce2b6cf462dc7672..6fcea705fbe4c5425367e5dedd707dc1801ad2d2 100644 (file)
--- a/src/chrony.c
+++ b/src/chrony.c
/* Initialize the sequence number generator from /dev/urandom */
/* Fallbacks: /dev/random and time(NULL) */
+ int fh;
+
/* Try urandom */
- int fh = open(URAND_DEVICE_PATH, O_RDONLY);
+ fh = open(URAND_DEVICE_PATH, O_RDONLY);
if (fh >= 0)
{
ssize_t rc = read(fh, &g_chrony_rand, sizeof(g_chrony_rand));
if (errno == ENOENT)
{
/* URAND_DEVICE_PATH device not found. Try RAND_DEVICE_PATH as fall-back */
- int fh = open(RAND_DEVICE_PATH, O_RDONLY);
+ fh = open(RAND_DEVICE_PATH, O_RDONLY);
if (fh >= 0)
{
ssize_t rc = read(fh, &g_chrony_rand, sizeof(g_chrony_rand));