RIP BOOL. Convert BOOL -> bool. I found a few interesting
[ira/wip.git] / source3 / nmbd / nmbd_elections.c
index 3aadd70b83ccdee828b5aa2d1520ff4471c00c21..db32461f060f91a19bb0041ef0f97b6056ca33d3 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
 */
 
@@ -53,7 +52,7 @@ static void send_election_dgram(struct subnet_record *subrec, const char *workgr
        strupper_m(srv_name);
        /* The following call does UNIX -> DOS charset conversion. */
        pstrcpy_base(p, srv_name, outbuf);
-       p = skip_string(p,1);
+       p = skip_string(outbuf,sizeof(outbuf),p);
   
        send_mailslot(False, BROWSE_MAILSLOT, outbuf, PTR_DIFF(p,outbuf),
                global_myname(), 0,
@@ -217,7 +216,7 @@ yet registered on subnet %s\n", nmb_namestr(&nmbname), subrec->subnet_name ));
   Determine if I win an election.
 ******************************************************************/
 
-static BOOL win_election(struct work_record *work, int version,
+static bool win_election(struct work_record *work, int version,
                          uint32 criterion, int timeup, const char *server_name)
 {  
        int mytimeup = time(NULL) - StartupTime;
@@ -329,10 +328,10 @@ done:
   be done by run_elections().
 ***************************************************************************/
 
-BOOL check_elections(void)
+bool check_elections(void)
 {
        struct subnet_record *subrec;
-       BOOL run_any_election = False;
+       bool run_any_election = False;
 
        for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
                struct work_record *work;
@@ -378,8 +377,11 @@ yet registered on subnet %s\n", nmb_namestr(&nmbname), subrec->subnet_name ));
  Process a internal Samba message forcing an election.
 ***************************************************************************/
 
-void nmbd_message_election(int msg_type, struct process_id src,
-                          void *buf, size_t len, void *private_data)
+void nmbd_message_election(struct messaging_context *msg,
+                          void *private_data,
+                          uint32_t msg_type,
+                          struct server_id server_id,
+                          DATA_BLOB *data)
 {
        struct subnet_record *subrec;