Author: jmcd Date: 2006-07-18 17:10:33 +0000 (Tue, 18 Jul 2006) New Revision: 17120
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17120 Log: >From Aleksey Fedoseev: Correcting two bugs: - check "is process the lock daemon" (procid_is_me compares pids, when locking daemon has process_id structure with pid == -2); - deregistering message handlers for the locking daemon implementation Hop...hop...hop... Modified: branches/tmp/vl-messaging/source/lib/messages_socket.c branches/tmp/vl-messaging/source/lib/messages_stream.c Changeset: Modified: branches/tmp/vl-messaging/source/lib/messages_socket.c =================================================================== --- branches/tmp/vl-messaging/source/lib/messages_socket.c 2006-07-18 15:12:49 UTC (rev 17119) +++ branches/tmp/vl-messaging/source/lib/messages_socket.c 2006-07-18 17:10:33 UTC (rev 17120) @@ -108,7 +108,9 @@ socket_fd = -1; } - if(mtype != MESSAGING_TYPE_DISPATCHER) { + if(mtype == MESSAGING_TYPE_DISPATCHER) { + deregister_dispatcher_messages(); + } else { if (procid_is_me(&socket_pid)) { char *path = NULL; asprintf(&path, "%s/%s", lock_path("messaging"), Modified: branches/tmp/vl-messaging/source/lib/messages_stream.c =================================================================== --- branches/tmp/vl-messaging/source/lib/messages_stream.c 2006-07-18 15:12:49 UTC (rev 17119) +++ branches/tmp/vl-messaging/source/lib/messages_stream.c 2006-07-18 17:10:33 UTC (rev 17120) @@ -1006,7 +1006,8 @@ #ifdef WITH_CLUSTERWIDE_MESSAGING lockd_pid.ip = *interpret_addr2(lp_locking_address()); - is_lockd = procid_is_me(&lockd_pid); + /* TODO: improve next line */ + is_lockd = (strcmp(lp_locking_address(), lp_messaging_address()) == 0); #else is_lockd = True; #endif /* WITH_CLUSTERWIDE_MESSAGING */ @@ -1067,6 +1068,18 @@ } /**************************************************************************** + Deregister locking messages +****************************************************************************/ + +void deregister_dispatcher_messages(void) +{ + if((enum locking_type)lp_locking_type() == LOCKING_TYPE_MESSAGES) { + message_deregister(MSG_DB_INIT); + message_deregister(MSG_DB_FETCHLOCK); + } +} + +/**************************************************************************** Fork the messaging daemon ****************************************************************************/
