From 7d2e572aca7297ea2015d2b6e7c71b672521ec82 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 20 Mar 2021 19:04:03 +0900 Subject: lei: All Local Externals: bare git dir for alternates This will be used for keyword (and label) storage for externals. We'll be using this to ensure we don't redundantly auto-import messages into lei/store if they're already in a local external (they can still be imported explicitly via "lei import"). --- lib/PublicInbox/Lock.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Lock.pm') diff --git a/lib/PublicInbox/Lock.pm b/lib/PublicInbox/Lock.pm index 76c3ffb2..0ee2a8bd 100644 --- a/lib/PublicInbox/Lock.pm +++ b/lib/PublicInbox/Lock.pm @@ -16,7 +16,7 @@ sub lock_acquire { my $lock_path = $self->{lock_path}; croak 'already locked '.($lock_path // '(undef)') if $self->{lockfh}; return unless defined($lock_path); - sysopen(my $lockfh, $lock_path, O_WRONLY|O_CREAT) or + sysopen(my $lockfh, $lock_path, O_RDWR|O_CREAT) or croak "failed to open $lock_path: $!\n"; flock($lockfh, LOCK_EX) or croak "lock $lock_path failed: $!\n"; $self->{lockfh} = $lockfh; -- cgit v1.2.3-24-ge0c7