mbox-lock.c revision 0d16525a729011f4fced989a3da74d755ea49e6d
1057N/A#include "restrict-access.h"
1589N/A#include "nfs-workarounds.h"
1057N/A#include "mail-index-private.h"
660N/A#include "mbox-storage.h"
1057N/A#include "mbox-file.h"
1057N/A#include "mbox-lock.h"
1057N/A#ifdef HAVE_FLOCK
2506N/Aenum mbox_lock_type {
2557N/Aenum mbox_dotlock_op {
2437N/Astruct mbox_lock_context {
2557N/A bool checked_file;
2557N/A bool dotlock_last_stale;
2557N/A bool fcntl_locked;
2557N/A bool using_privileges;
2557N/Astruct mbox_lock_data {
2437N/A#ifdef HAVE_FLOCK
2437N/A#ifdef HAVE_LOCKF
2557N/Astatic void mbox_init_lock_settings(void)
2437N/A if (restrict_access_use_priv_gid() < 0) {
2095N/A if (restrict_access_use_priv_gid() < 0) {
2557N/A case MBOX_DOTLOCK_OP_LOCK:
2506N/A case MBOX_DOTLOCK_OP_TOUCH:
2557N/A#ifdef HAVE_FLOCK
2679N/A last_notify = 0;
2506N/A#ifdef HAVE_LOCKF
2557N/A last_notify = 0;
2095N/A unsigned int next_alarm;
2437N/A if (max_wait_time == 0) {
1589N/A if (next_alarm == 0)
2506N/A bool *fcntl_locked_r)
2437N/A bool drop_locks;
2437N/A for (i = 0; i < MBOX_LOCK_COUNT; i++)
2437N/A if (!drop_locks)
2437N/A if (drop_locks) {
1703N/A bool fcntl_locked;
1589N/A if (fcntl_locked) {
2506N/A bool fcntl_locked;
2679N/A &fcntl_locked) < 0)
2506N/A for (i = 0; i < MBOX_LOCK_COUNT; i++)