mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Thu Jan 7 18:00:58 CET 1999 Werner Koch
This commit is contained in:
parent
e3e8d9b92f
commit
7d0efec7cf
31 changed files with 621 additions and 223 deletions
23
g10/tdbio.c
23
g10/tdbio.c
|
@ -389,11 +389,25 @@ tdbio_cancel_transaction()
|
|||
**************** cached I/O functions ******************
|
||||
********************************************************/
|
||||
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
if( lockname ) {
|
||||
release_dotlock(lockname);
|
||||
lockname = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
tdbio_set_dbname( const char *new_dbname, int create )
|
||||
{
|
||||
char *fname;
|
||||
static int initialized = 0;
|
||||
|
||||
if( !initialized ) {
|
||||
atexit( cleanup );
|
||||
initialized = 1;
|
||||
}
|
||||
fname = new_dbname? m_strdup( new_dbname )
|
||||
: make_filename(opt.homedir, "trustdb.gpg", NULL );
|
||||
|
||||
|
@ -480,14 +494,6 @@ tdbio_get_dbname()
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
if( lockname ) {
|
||||
release_dotlock(lockname);
|
||||
lockname = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
open_db()
|
||||
|
@ -504,7 +510,6 @@ open_db()
|
|||
log_fatal( _("%s: can't open: %s\n"), db_name, strerror(errno) );
|
||||
if( tdbio_read_record( 0, &rec, RECTYPE_VER ) )
|
||||
log_fatal( _("%s: invalid trustdb\n"), db_name );
|
||||
atexit( cleanup );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue