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

Renamed the lock functions.

Also cleaned up the dotlock code for easier readability.
This commit is contained in:
Werner Koch 2011-09-23 14:43:58 +02:00
parent acde3f8ea6
commit b73ae3ca36
16 changed files with 564 additions and 399 deletions

View file

@ -246,10 +246,10 @@ g13_create_container (ctrl_t ctrl, const char *filename, strlist_t keys)
/* Take a lock and proceed with the creation. If there is a lock we
immediately return an error because for creation it does not make
sense to wait. */
lock = create_dotlock (filename);
lock = dotlock_create (filename);
if (!lock)
return gpg_error_from_syserror ();
if (make_dotlock (lock, 0))
if (dotlock_take (lock, 0))
{
err = gpg_error_from_syserror ();
goto leave;
@ -319,7 +319,7 @@ g13_create_container (ctrl_t ctrl, const char *filename, strlist_t keys)
xfree (detachedname);
xfree (enckeyblob);
xfree (keyblob);
destroy_dotlock (lock);
dotlock_destroy (lock);
return err;
}

View file

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

View file

@ -273,14 +273,14 @@ g13_mount_container (ctrl_t ctrl, const char *filename, const char *mountpoint)
}
/* Try to take a lock. */
lock = create_dotlock (filename);
lock = dotlock_create (filename);
if (!lock)
{
xfree (mountpoint_buffer);
return gpg_error_from_syserror ();
}
if (make_dotlock (lock, 0))
if (dotlock_take (lock, 0))
{
err = gpg_error_from_syserror ();
goto leave;
@ -359,7 +359,7 @@ g13_mount_container (ctrl_t ctrl, const char *filename, const char *mountpoint)
destroy_tupledesc (tuples);
xfree (keyblob);
xfree (enckeyblob);
destroy_dotlock (lock);
dotlock_destroy (lock);
xfree (mountpoint_buffer);
return err;
}