summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-05 10:22:50 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-05 15:07:35 +0100
commitc34d5f445aae8180650dd2cae994bd5573870c04 (patch)
treec5787935da005402ce64fda6890a1137363235f1 /source3/lib
parentee5be748e64f6c8f4814ff322e38511a9a65f4fc (diff)
downloadsamba-c34d5f445aae8180650dd2cae994bd5573870c04.tar.gz
samba-c34d5f445aae8180650dd2cae994bd5573870c04.tar.bz2
samba-c34d5f445aae8180650dd2cae994bd5573870c04.zip
s3:events: change event_add_timed() prototype to match samba4
metze
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/async_req.c13
-rw-r--r--source3/lib/ctdbd_conn.c3
-rw-r--r--source3/lib/events.c8
-rw-r--r--source3/lib/smbldap.c12
4 files changed, 17 insertions, 19 deletions
diff --git a/source3/lib/async_req.c b/source3/lib/async_req.c
index ac06df65a3..13b64ba79a 100644
--- a/source3/lib/async_req.c
+++ b/source3/lib/async_req.c
@@ -103,12 +103,12 @@ void async_req_error(struct async_req *req, NTSTATUS status)
* @brief Timed event callback
* @param[in] ev Event context
* @param[in] te The timed event
- * @param[in] now current time
+ * @param[in] now zero time
* @param[in] priv The async request to be finished
*/
static void async_trigger(struct event_context *ev, struct timed_event *te,
- const struct timeval *now, void *priv)
+ struct timeval now, void *priv)
{
struct async_req *req = talloc_get_type_abort(priv, struct async_req);
@@ -139,7 +139,7 @@ bool async_post_status(struct async_req *req, struct event_context *ev,
{
req->status = status;
- if (event_add_timed(ev, req, timeval_zero(), "async_trigger",
+ if (event_add_timed(ev, req, timeval_zero(),
async_trigger, req) == NULL) {
return false;
}
@@ -197,7 +197,7 @@ NTSTATUS async_req_simple_recv(struct async_req *req)
static void async_req_timedout(struct event_context *ev,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *priv)
{
struct async_req *req = talloc_get_type_abort(
@@ -211,7 +211,7 @@ bool async_req_set_timeout(struct async_req *req, struct event_context *ev,
{
return (event_add_timed(ev, req,
timeval_current_ofs(to.tv_sec, to.tv_usec),
- "async_req_timedout", async_req_timedout, req)
+ async_req_timedout, req)
!= NULL);
}
@@ -268,7 +268,7 @@ static int async_queue_entry_destructor(struct async_queue_entry *e)
static void async_req_immediate_trigger(struct event_context *ev,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *priv)
{
struct async_queue_entry *e = talloc_get_type_abort(
@@ -303,7 +303,6 @@ bool async_req_enqueue(struct async_req_queue *queue, struct event_context *ev,
struct timed_event *te;
te = event_add_timed(ev, e, timeval_zero(),
- "async_req_immediate_trigger",
async_req_immediate_trigger,
e);
if (te == NULL) {
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 75a513312e..c94ef802c4 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -200,7 +200,7 @@ struct deferred_msg_state {
static void deferred_message_dispatch(struct event_context *event_ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data)
{
struct deferred_msg_state *state = talloc_get_type_abort(
@@ -383,7 +383,6 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32 reqid,
evt = event_add_timed(conn->msg_ctx->event_ctx,
conn->msg_ctx->event_ctx,
timeval_zero(),
- "deferred_message_dispatch",
deferred_message_dispatch,
msg_state);
if (evt == NULL) {
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 0e3fecfaa2..203cfccd14 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -27,7 +27,7 @@ struct timed_event {
const char *event_name;
void (*handler)(struct event_context *event_ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data);
void *private_data;
};
@@ -88,13 +88,13 @@ static void add_event_by_time(struct timed_event *te)
handed to it.
****************************************************************************/
-struct timed_event *event_add_timed(struct event_context *event_ctx,
+struct timed_event *_event_add_timed(struct event_context *event_ctx,
TALLOC_CTX *mem_ctx,
struct timeval when,
const char *event_name,
void (*handler)(struct event_context *event_ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data),
void *private_data)
{
@@ -241,7 +241,7 @@ bool run_events(struct event_context *event_ctx,
event_ctx->timed_events->handler(
event_ctx,
- event_ctx->timed_events, &now,
+ event_ctx->timed_events, now,
event_ctx->timed_events->private_data);
fired = True;
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index f2161dc946..f0561a5081 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -1014,7 +1014,7 @@ static int smbldap_connect_system(struct smbldap_state *ldap_state, LDAP * ldap_
static void smbldap_idle_fn(struct event_context *event_ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data);
/**********************************************************************
@@ -1079,7 +1079,7 @@ static int smbldap_open(struct smbldap_state *ldap_state)
ldap_state->idle_event = event_add_timed(
ldap_state->event_context, NULL,
timeval_current_ofs(SMBLDAP_IDLE_TIME, 0),
- "smbldap_idle_fn", smbldap_idle_fn, ldap_state);
+ smbldap_idle_fn, ldap_state);
}
DEBUG(4,("The LDAP server is successfully connected\n"));
@@ -1572,7 +1572,7 @@ int smbldap_search_suffix (struct smbldap_state *ldap_state,
static void smbldap_idle_fn(struct event_context *event_ctx,
struct timed_event *te,
- const struct timeval *now,
+ struct timeval now,
void *private_data)
{
struct smbldap_state *state = (struct smbldap_state *)private_data;
@@ -1584,13 +1584,13 @@ static void smbldap_idle_fn(struct event_context *event_ctx,
return;
}
- if ((state->last_use+SMBLDAP_IDLE_TIME) > now->tv_sec) {
+ if ((state->last_use+SMBLDAP_IDLE_TIME) > now.tv_sec) {
DEBUG(10,("ldap connection not idle...\n"));
state->idle_event = event_add_timed(
event_ctx, NULL,
- timeval_add(now, SMBLDAP_IDLE_TIME, 0),
- "smbldap_idle_fn", smbldap_idle_fn,
+ timeval_add(&now, SMBLDAP_IDLE_TIME, 0),
+ smbldap_idle_fn,
private_data);
return;
}