Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DB_File-windows bug: does not return the DB fd for locking

  • Loading branch information...
commit 1607e20e79dbb26aa2469a36350b7637c5ebae92 1 parent 72f47aa
@semuel authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Dist/Surveyor.pm
View
8 lib/Dist/Surveyor.pm
@@ -93,8 +93,12 @@ if (not $opt_uncached) {
# XXX this locking is flawed but good enough for my needs
# http://search.cpan.org/~pmqs/DB_File-1.824/DB_File.pm#HINTS_AND_TIPS
my $fd = $db->fd;
- open(my $DB_FH, "+<&=$fd") || die "dup $!";
- flock ($DB_FH, LOCK_EX) || die "flock: $!";
+ # bug in DB_File on windows causes it to always return 0
+ # in this case, skip the locking
+ if ($fd > 0) {
+ open(my $DB_FH, "+<&=$fd") || die "dup $!";
+ flock ($DB_FH, LOCK_EX) || die "flock: $!";
+ }
}
my %memoize_subs = (
get_candidate_cpan_dist_releases => { generation => 1 },
Please sign in to comment.
Something went wrong with that request. Please try again.