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,
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/>.
*/
******************************************************************/
static void reset_workgroup_state( struct subnet_record *subrec, const char *workgroup_name,
- BOOL force_new_election )
+ bool force_new_election )
{
struct work_record *work;
struct server_record *servrec;
struct nmb_name *released_name,
struct in_addr released_ip)
{
- BOOL force_new_election = False;
+ bool force_new_election = False;
unstring relname;
- memcpy((char *)&force_new_election, userdata->data, sizeof(BOOL));
+ memcpy((char *)&force_new_election, userdata->data, sizeof(bool));
DEBUG(3,("unbecome_local_master_success: released name %s.\n",
nmb_namestr(released_name)));
{
struct name_record *namerec;
struct userdata_struct *userdata = rrec->userdata;
- BOOL force_new_election = False;
+ bool force_new_election = False;
unstring failname;
- memcpy((char *)&force_new_election, userdata->data, sizeof(BOOL));
+ memcpy((char *)&force_new_election, userdata->data, sizeof(bool));
DEBUG(0,("unbecome_local_master_fail: failed to release name %s. \
Removing from namelist anyway.\n", nmb_namestr(fail_name)));
******************************************************************/
static void release_1d_name( struct subnet_record *subrec, const char *workgroup_name,
- BOOL force_new_election)
+ bool force_new_election)
{
struct nmb_name nmbname;
struct name_record *namerec;
make_nmb_name(&nmbname, workgroup_name, 0x1d);
if((namerec = find_name_on_subnet( subrec, &nmbname, FIND_SELF_NAME))!=NULL) {
struct userdata_struct *userdata;
- size_t size = sizeof(struct userdata_struct) + sizeof(BOOL);
+ size_t size = sizeof(struct userdata_struct) + sizeof(bool);
- if((userdata = (struct userdata_struct *)malloc(size)) == NULL) {
+ if((userdata = (struct userdata_struct *)SMB_MALLOC(size)) == NULL) {
DEBUG(0,("release_1d_name: malloc fail.\n"));
return;
}
userdata->copy_fn = NULL;
userdata->free_fn = NULL;
- userdata->userdata_len = sizeof(BOOL);
- memcpy((char *)userdata->data, &force_new_election, sizeof(BOOL));
+ userdata->userdata_len = sizeof(bool);
+ memcpy((char *)userdata->data, &force_new_election, sizeof(bool));
release_name(subrec, namerec,
unbecome_local_master_success,
******************************************************************/
void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
- BOOL force_new_election)
+ bool force_new_election)
{
struct name_record *namerec;
struct nmb_name nmbname;
subrec->work_changed = True;
/* Setup the userdata_struct. */
- if((userdata = (struct userdata_struct *)malloc(size)) == NULL) {
+ if((userdata = (struct userdata_struct *)SMB_MALLOC(size)) == NULL) {
DEBUG(0,("become_local_master_browser: malloc fail.\n"));
return;
}