From 31e7f065a17bea2a1de653505b73a64a7c54a4af Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 20 May 2008 20:42:14 +0200 Subject: [PATCH] Regenerate database upon crash (by setting the DB version last) --- dowkd.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dowkd.in b/dowkd.in index 84915b1..e492a7d 100644 --- a/dowkd.in +++ b/dowkd.in @@ -85,7 +85,6 @@ sub create_db () { $db = tie %db, 'DB_File', $db_file, O_RDWR | O_CREAT, 0777, $DB_BTREE or die "error: could not open database: $!\n"; - $db{''} = $db_version; while (my $line = ) { next if $line =~ /^\**$/; chomp $line; @@ -94,6 +93,9 @@ sub create_db () { $db{$line} = ''; } + # Set at the end so that no incomplete database is left behind. + $db{''} = $db_version; + $db->sync; } -- 2.11.4.GIT