Commit Graph

8 Commits

Author SHA1 Message Date
Werner Koch 937aeb1904
common: Add an info callback to dotlock.
* common/dotlock.h (enum dotlock_reasons): New.
(DOTLOCK_PREPARE_CREATE): New flag.
* common/dotlock.c (struct dotlock_handle): Add info_cb and
info_cb_value.
(dotlock_create): Support the new flag.
(dotlock_finish_create): New.
(read_lockfile): Silence in case of ENOENT.
(dotlock_set_info_cb): New.  Use callback after all error and info
messages.
(dotlock_take_unix, dotlock_take_w32): Allow termination by callback.
2023-12-18 15:21:26 +01:00
Werner Koch d2d7a2b128
Remove remaining support for WindowsCE
--
2022-06-03 10:08:21 +02:00
NIIBE Yutaka a30359cecb common: More heavy test condition for t-dotlock.c.
* common/t-dotlock.c (lock_and_unlock): Use usleep and faster.
Loop at least once.  Use getrandom for random time.
(main): Add new option --one-shot to run lock/unlock once.

--

GnuPG-bug-id: 5884
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2022-03-18 12:01:45 +09:00
Werner Koch b47c355b18
w32: Allow Unicode filenames for dotlock
* common/dotlock.c (any8bitchar) [W32]: New.
(dotlock_create_w32): Use strconcat and CreateFileW.

* common/t-dotlock.c: Source include dotlock.c and modify to allow
manual testing on Windows.
--

GnuPG-bug-id: 5098
Signed-off-by: Werner Koch <wk@gnupg.org>
2020-10-20 13:38:11 +02:00
Werner Koch 4d7dc432b5
Change all http://www.gnu.org in license notices to https://
--
2016-11-05 12:02:19 +01:00
Werner Koch 096e7457ec Change all quotes in strings and comments to the new GNU standard.
The asymmetric quotes used by GNU in the past (`...') don't render
nicely on modern systems.  We now use two \x27 characters ('...').

The proper solution would be to use the correct Unicode symmetric
quotes here.  However this has the disadvantage that the system
requires Unicode support.  We don't want that today.  If Unicode is
available a generated po file can be used to output proper quotes.  A
simple sed script like the one used for en@quote is sufficient to
change them.

The changes have been done by applying

  sed -i "s/\`\([^'\`]*\)'/'\1'/g"

to most files and fixing obvious problems by hand.  The msgid strings in
the po files were fixed with a similar command.
2012-06-05 19:29:22 +02:00
Werner Koch ed8e267859 Add a flag parameter to dotlock_create.
This allows us to extend this function in the future.
2011-09-28 15:41:58 +02:00
Werner Koch 8a033fecfb Improved the dotlock module.
- It is now more portable and may be used outside of GnuPG
- vfat file systems are now supported.
- The use of link(2) is more robust.
- Wrote extensive documentation.
2011-09-27 17:18:56 +02:00