Home GnuPG
Diffusion GnuPG 6b4fd3a5da7e

common: Enhance dotlock, so that we can have a CLI util.

Description

common: Enhance dotlock, so that we can have a CLI util.

* common/dotlock.h (DOTLOCK_LOCK_BY_PARENT, DOTLOCK_LOCKED): New.
* common/dotlock.c [HAVE_POSIX_SYSTEM]: Include <dirent.h>.
(dotlock_get_process_id, dotlock_detect_tname): New.
(dotlock_create_unix): Handle the case when no_write option is
specified.  Not creating the lock file, but detect the the file of
tname.
(dotlock_create) [HAVE_POSIX_SYSTEM]: Add support of
DOTLOCK_LOCK_BY_PARENT and DOTLOCK_LOCKED for dotlock CLI util.
(dotlock_take_unix): Support the case of DOTLOCK_LOCK_BY_PARENT.
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Dec 19 2023, 7:59 AM
Parents
rG1c5584c395d7: kbx: Create public-keys.d, after creating the homedir.
Branches
Unknown
Tags
Unknown