RIP BOOL. Convert BOOL -> bool. I found a few interesting
[kamenim/samba.git] / source3 / lib / server_mutex.c
index 878e5497d8e86df3d6edec44d65043dc6d52c4e7..2700aa103b106fb5cd0b43cd9d2bdd2dae912239 100644 (file)
@@ -6,7 +6,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,
@@ -15,8 +15,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/>.
 */
 
 #include "includes.h"
    like the single-connection that NT makes. */
 
 static char *mutex_server_name;
-/* FIXME. ref_count should be allocated per name... JRA. */
-size_t ref_count;
 
-BOOL grab_server_mutex(const char *name)
+bool grab_server_mutex(const char *name)
 {
-       mutex_server_name = strdup(name);
+       mutex_server_name = SMB_STRDUP(name);
        if (!mutex_server_name) {
                DEBUG(0,("grab_server_mutex: malloc failed for %s\n", name));
                return False;
        }
-       if (!secrets_named_mutex(mutex_server_name, 10, &ref_count)) {
+       if (!secrets_named_mutex(mutex_server_name, 10)) {
                DEBUG(10,("grab_server_mutex: failed for %s\n", name));
                SAFE_FREE(mutex_server_name);
                return False;
@@ -52,7 +49,7 @@ BOOL grab_server_mutex(const char *name)
 void release_server_mutex(void)
 {
        if (mutex_server_name) {
-               secrets_named_mutex_release(mutex_server_name, &ref_count);
+               secrets_named_mutex_release(mutex_server_name);
                SAFE_FREE(mutex_server_name);
        }
 }