aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/worker_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-09 11:19:18 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-09 11:19:18 +0000
commit46199908867cb6f4eb6aee6d065f8e3bae4a0a39 (patch)
tree3d93ca3cd038cb56b110d6192a4df3d7d14eed25 /src/libserver/worker_util.c
parent18e4eec3711b5db6f32c189877d3baebe551f548 (diff)
downloadrspamd-46199908867cb6f4eb6aee6d065f8e3bae4a0a39.tar.gz
rspamd-46199908867cb6f4eb6aee6d065f8e3bae4a0a39.zip
Treat PRNG init errors as fatal
Diffstat (limited to 'src/libserver/worker_util.c')
-rw-r--r--src/libserver/worker_util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 5d8b8c608..f404a3295 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -439,6 +439,7 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main,
guint index)
{
struct rspamd_worker *cur;
+ gint rc;
/* Starting worker process */
cur = (struct rspamd_worker *) g_malloc0 (sizeof (struct rspamd_worker));
@@ -462,7 +463,12 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main,
rspamd_log_update_pid (cf->type, rspamd_main->logger);
/* Lock statfile pool if possible XXX */
/* Init PRNG after fork */
- ottery_init (NULL);
+ rc = ottery_init (NULL);
+ if (rc != OTTERY_ERR_NONE) {
+ msg_err_main ("cannot initialize PRNG: %d", rc);
+ g_assert (0);
+ }
+
g_random_set_seed (ottery_rand_uint32 ());
/* Drop privilleges */
rspamd_worker_drop_priv (rspamd_main);