Subject: | Patch to fix POSIX locking on Darwin |
Date: | Mon, 10 Aug 2009 12:29:31 +1000 |
To: | bug-Mail-Box [...] rt.cpan.org |
From: | Jim In Aus <jiminaus [...] gmail.com> |
I've just moved from FreeBSD (VM under Windows) to a Mac OS X
(yeah!!). I've hit an issue with Mail-Box-2.090 on Mac OS X 10.5.8
with perl 5.8.9. In the sub _try_lock of Mail::Box::Locker::POSIX,
the call to fcntl is resulting in an invalid argument errno. I think
darwin's definition for the flock structure is different from what's
been coded for.
Attached is a patch which moves Mail::Box::Locker::POSIX from using a
hard-coded pack to create a flock structure and directly calling
fcntl, to using the File-FcntlLock-0.10 CPAN module by JTT. This
modules calculates the offsets of the fields within the flock
structure for the platform when it's installed. Using this code, the
POSIX locker now works on Mac OS X. I think it would also shield the
POSIX locker from other platform differences and from 32-bit/64-bit
issues as well?
Message body is not shown because sender requested not to inline it.