Commit ba12d923 authored by Magnus Holmgren's avatar Magnus Holmgren Committed by Niels Möller

Show the intended error message when no seed file exists.

parent ff6ee16f
2013-04-19 Magnus Holmgren <holmgren@debian.org>
* src/unix_random.c (random_init): Show the intended error message
when no seed file exists, instead of one about a locking error.
2013-04-03 Niels Mller <nisse@lysator.liu.se>
From master branch:
......
......@@ -357,6 +357,15 @@ random_init(struct lsh_string *seed_file_name)
yarrow256_init(&self->yarrow, RANDOM_NSOURCES, self->sources);
if (access(lsh_get_cstring(seed_file_name), F_OK) < 0)
{
werror("No seed file. Please create one by running\n");
werror("lsh-make-seed -o \"%S\".\n", seed_file_name);
KILL(self);
return NULL;
}
verbose("Reading seed-file `%S'\n", seed_file_name);
self->lock
......@@ -378,8 +387,7 @@ random_init(struct lsh_string *seed_file_name)
self->seed_file_fd = open(lsh_get_cstring(seed_file_name), O_RDWR);
if (self->seed_file_fd < 0)
{
werror("No seed file. Please create one by running\n");
werror("lsh-make-seed -o \"%S\".\n", seed_file_name);
werror("Could not open seed file \"%S\".\n", seed_file_name);
KILL_RESOURCE(lock);
KILL(self);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment