1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Add a flag parameter to dotlock_create.

This allows us to extend this function in the future.
This commit is contained in:
Werner Koch 2011-09-28 15:41:58 +02:00
parent 567a31c2a0
commit ed8e267859
15 changed files with 37 additions and 24 deletions

View file

@ -1969,7 +1969,7 @@ main (int argc, char **argv)
gnupg_init_signals (0, emergency_cleanup);
dotlock_create (NULL); /* Register lock file cleanup. */
dotlock_create (NULL, 0); /* Register lock file cleanup. */
opt.session_env = session_env_new ();
if (!opt.session_env)

View file

@ -507,9 +507,10 @@ dotlock_disable (void)
}
dotlock_t
dotlock_create (const char *file_to_lock)
dotlock_create (const char *file_to_lock, unsigned int flags)
{
(void)file_to_lock;
(void)flags;
return NULL;
}

View file

@ -136,7 +136,7 @@ maybe_create_keyring (char *filename, int force)
/* To avoid races with other instances of gpg trying to create or
update the keyring (it is removed during an update for a short
time), we do the next stuff in a locked state. */
lockhd = dotlock_create (filename);
lockhd = dotlock_create (filename, 0);
if (!lockhd)
{
/* A reason for this to fail is that the directory is not

View file

@ -306,7 +306,7 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
if (!keyring_is_writable(kr))
continue;
if (!kr->lockhd) {
kr->lockhd = dotlock_create( kr->fname );
kr->lockhd = dotlock_create (kr->fname, 0);
if (!kr->lockhd) {
log_info ("can't allocate lock for `%s'\n", kr->fname );
rc = G10ERR_GENERAL;

View file

@ -544,7 +544,7 @@ tdbio_set_dbname( const char *new_dbname, int create )
db_name = fname;
#ifdef __riscos__
if( !lockhandle )
lockhandle = dotlock_create (db_name);
lockhandle = dotlock_create (db_name, 0);
if( !lockhandle )
log_fatal( _("can't create lock for `%s'\n"), db_name );
if( dotlock_make (lockhandle, -1) )
@ -567,7 +567,7 @@ tdbio_set_dbname( const char *new_dbname, int create )
#ifndef __riscos__
if( !lockhandle )
lockhandle = dotlock_create (db_name);
lockhandle = dotlock_create (db_name, 0);
if( !lockhandle )
log_fatal( _("can't create lock for `%s'\n"), db_name );
#endif /* !__riscos__ */
@ -608,7 +608,7 @@ open_db()
assert( db_fd == -1 );
if (!lockhandle )
lockhandle = dotlock_create (db_name);
lockhandle = dotlock_create (db_name, 0);
if (!lockhandle )
log_fatal( _("can't create lock for `%s'\n"), db_name );
#ifdef __riscos__