s4:libcli/wrepl: implement wrepl_request_send as a tevent_req based wrapper
[kai/samba.git] / source4 / wrepl_server / wrepl_periodic.c
index c598bb8e8a8f525c500135770460a22d6de60a74..94391273ca978e7bb85fc5a32e6e752975781ae4 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,
    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"
 #include "lib/events/events.h"
 #include "smbd/service_task.h"
-#include "librpc/gen_ndr/ndr_winsrepl.h"
+#include "smbd/service.h"
+#include "librpc/gen_ndr/winsrepl.h"
 #include "wrepl_server/wrepl_server.h"
 
 static NTSTATUS wreplsrv_periodic_run(struct wreplsrv_service *service)
@@ -45,7 +45,7 @@ static NTSTATUS wreplsrv_periodic_run(struct wreplsrv_service *service)
        return NT_STATUS_OK;
 }
 
-static void wreplsrv_periodic_handler_te(struct event_context *ev, struct timed_event *te,
+static void wreplsrv_periodic_handler_te(struct tevent_context *ev, struct tevent_timer *te,
                                         struct timeval t, void *ptr)
 {
        struct wreplsrv_service *service = talloc_get_type(ptr, struct wreplsrv_service);
@@ -55,7 +55,7 @@ static void wreplsrv_periodic_handler_te(struct event_context *ev, struct timed_
 
        status = wreplsrv_periodic_schedule(service, service->config.periodic_interval);
        if (!NT_STATUS_IS_OK(status)) {
-               task_server_terminate(service->task, nt_errstr(status));
+               task_server_terminate(service->task, nt_errstr(status), false);
                return;
        }
 
@@ -68,7 +68,7 @@ static void wreplsrv_periodic_handler_te(struct event_context *ev, struct timed_
 NTSTATUS wreplsrv_periodic_schedule(struct wreplsrv_service *service, uint32_t next_interval)
 {
        TALLOC_CTX *tmp_mem;
-       struct timed_event *new_te;
+       struct tevent_timer *new_te;
        struct timeval next_time;
 
        /* prevent looping */