r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[samba.git] / source3 / torture / vfstest.c
index 61bb4b0bf654abbc4ebf26ee44d7a3fdadf945db..5720d662fda7199e9a6c384e9ac8ad688f26875b 100644 (file)
@@ -11,7 +11,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,
@@ -20,8 +20,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"
@@ -479,6 +478,27 @@ BOOL reload_services(BOOL test)
        return (ret);
 }
 
+struct event_context *smbd_event_context(void)
+{
+       static struct event_context *ctx;
+
+       if (!ctx && !(ctx = event_context_init(NULL))) {
+               smb_panic("Could not init smbd event context\n");
+       }
+       return ctx;
+}
+
+struct messaging_context *smbd_messaging_context(void)
+{
+       static struct messaging_context *ctx;
+
+       if (!ctx && !(ctx = messaging_init(NULL, server_id_self(),
+                                          smbd_event_context()))) {
+               smb_panic("Could not init smbd messaging context\n");
+       }
+       return ctx;
+}
+
 /* Main function */
 
 int main(int argc, char *argv[])
@@ -575,6 +595,6 @@ int main(int argc, char *argv[])
                        process_cmd(&vfs, line);
        }
        
-       free(vfs.conn);
+       conn_free(vfs.conn);
        return 0;
 }