summaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/tdbio.c')
-rw-r--r--g10/tdbio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index 2eddb4b2d..6aaa18012 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -466,6 +466,11 @@ tdbio_set_dbname( const char *new_dbname, int create )
if( db_fd == -1 )
log_fatal( _("%s: can't open: %s\n"), db_name, strerror(errno) );
+ if( !lockhandle )
+ lockhandle = create_dotlock( db_name );
+ if( !lockhandle )
+ log_fatal( _("%s: can't create lock\n"), db_name );
+
memset( &rec, 0, sizeof rec );
rec.r.ver.version = 2;
rec.r.ver.created = make_timestamp();