|
From: Claudio V. C. <ro...@us...> - 2009-06-09 08:20:57
|
Build Version : T2.5.0.24181 Firebird 2.5 Beta 1 (writeBuildNum.sh,v 1.24345 2009/06/09 08:20:53 robocop Exp ) Update of /cvsroot/firebird/firebird2/src/remote In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10513/src/remote Modified Files: server.cpp Log Message: Paranoid checks. Index: server.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/remote/server.cpp,v retrieving revision 1.253 retrieving revision 1.254 diff -b -U3 -r1.253 -r1.254 --- server.cpp 9 Jun 2009 05:55:17 -0000 1.253 +++ server.cpp 9 Jun 2009 08:20:51 -0000 1.254 @@ -79,10 +79,10 @@ struct srvr : public Firebird::GlobalStorage { - srvr* srvr_next; - rem_port* srvr_parent_port; - rem_port::rem_port_t srvr_port_type; - USHORT srvr_flags; + srvr* const srvr_next; + const rem_port* const srvr_parent_port; + const rem_port::rem_port_t srvr_port_type; + const USHORT srvr_flags; public: srvr(srvr* servers, rem_port* port, USHORT flags) : @@ -116,6 +116,11 @@ if (!(handle = CreateMutex(ISC_get_security_desc(), FALSE, mutex_name))) { + // MSDN: if the caller has limited access rights, the function will fail with + // ERROR_ACCESS_DENIED and the caller should use the OpenMutex function. + if (GetLastError() == ERROR_ACCESS_DENIED) + Firebird::system_call_failed::raise("CreateMutex - cannot open existing mutex"); + else Firebird::system_call_failed::raise("CreateMutex"); } |