Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 21 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21 magnus 1
#! /bin/sh /usr/share/dpatch/dpatch-run
34 magnus 2
## 40_mkdir_dotlsh.dpatch by Magnus Holmgren <holmgren@debian.org>
21 magnus 3
##
34 magnus 4
## DP: Show the intended error message, instead of one about a locking
5
## DP: error, when no seed file exists
21 magnus 6
 
7
@DPATCH@
8
diff -urNad trunk~/src/unix_random.c trunk/src/unix_random.c
9
--- trunk~/src/unix_random.c    2006-01-23 18:47:10.000000000 +0100
10
+++ trunk/src/unix_random.c     2008-06-24 22:29:29.000000000 +0200
11
@@ -353,6 +353,15 @@
12
 
13
     yarrow256_init(&self->yarrow, RANDOM_NSOURCES, self->sources);
14
 
15
+    if (access(lsh_get_cstring(seed_file_name), F_OK) < 0)
16
+      {
17
+       werror("No seed file. Please create one by running\n");
18
+       werror("lsh-make-seed -o \"%S\".\n", seed_file_name);
19
+
20
+       KILL(self);
21
+       return NULL;
22
+      }
23
+
24
     verbose("Reading seed-file `%S'\n", seed_file_name);
25
 
26
     self->lock
27
@@ -374,8 +383,7 @@
28
     self->seed_file_fd = open(lsh_get_cstring(seed_file_name), O_RDWR);
29
     if (self->seed_file_fd < 0)
30
       {
31
-       werror("No seed file. Please create one by running\n");
32
-       werror("lsh-make-seed -o \"%S\".\n", seed_file_name);
33
+       werror("Could not open seed file \"%S\".\n", seed_file_name);
34
 
35
        KILL_RESOURCE(lock);
36
        KILL(self);