summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2018-05-25 16:18:34 +0300
committerSergey Kandaurov <pluknet@nginx.com>2018-05-25 16:18:34 +0300
commit3befb08204f64983e684904ecd2cb20ff45dd3c2 (patch)
tree1b6c00d51d46d908072ddc41a295fcf9d634645a /src
parenta9ea218e7e119d7d7d050156835d4e16f41d0a6c (diff)
downloadunit-3befb08204f64983e684904ecd2cb20ff45dd3c2.tar.gz
unit-3befb08204f64983e684904ecd2cb20ff45dd3c2.tar.bz2
Fixed a dead store.
Found by Clang Static Analyzer.
Diffstat (limited to '')
-rw-r--r--src/nxt_random.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nxt_random.c b/src/nxt_random.c
index 27387b1f..0731b7fb 100644
--- a/src/nxt_random.c
+++ b/src/nxt_random.c
@@ -58,8 +58,6 @@ nxt_random_stir(nxt_random_t *r)
u_char bytes[NXT_RANDOM_KEY_SIZE];
} key;
- n = 0;
-
#if (NXT_HAVE_GETRANDOM)
n = getrandom(&key, NXT_RANDOM_KEY_SIZE, 0);
@@ -70,6 +68,10 @@ nxt_random_stir(nxt_random_t *r)
n = syscall(SYS_getrandom, &key, NXT_RANDOM_KEY_SIZE, 0);
+#else
+
+ n = 0;
+
#endif
if (n != NXT_RANDOM_KEY_SIZE) {