Hello,

current HEAD fails to build on my system because database file
yachts.lnk is open for reading and write lock on it is requested with
fcntl() which is not allowed.

This patch:

------------------------------------------------------------------------------
diff -up src/jrd/os/posix/unix.cpp.orig-rdlock src/jrd/os/posix/unix.cpp
--- src/jrd/os/posix/unix.cpp.orig-rdlock       2012-02-28 13:58:07.000000000 
+0100
+++ src/jrd/os/posix/unix.cpp   2012-02-29 13:00:11.484581400 +0100
@@ -645,7 +645,7 @@ jrd_file* PIO_open(Database* dbb,
        }
 
        const bool shareMode = dbb->dbb_config->getSharedDatabase();
-       if (!lockDatabaseFile(desc, shareMode))
+       if (!lockDatabaseFile(desc, shareMode || readOnly))
        {
                ERR_post(Arg::Gds(isc_io_error) << Arg::Str("lock") << 
Arg::Str(file_name) <<
                                 Arg::Gds(isc_io_open_err) << Arg::Unix(errno));
------------------------------------------------------------------------------

fixes the build on my system but I'm not sure it covers all scenarios
where a database file is open for reading. Alex, can you check it,
please?

                                                         Michal Kubeček


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to