diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/async_req/async_req.c | 42 | ||||
-rw-r--r-- | lib/async_req/async_req.h | 9 | ||||
-rw-r--r-- | lib/replace/libreplace_network.m4 | 2 | ||||
-rw-r--r-- | lib/talloc/configure.ac | 2 | ||||
-rw-r--r-- | lib/talloc/talloc.h | 3 |
5 files changed, 5 insertions, 53 deletions
diff --git a/lib/async_req/async_req.c b/lib/async_req/async_req.c index 054c9f97cc..4dfe809738 100644 --- a/lib/async_req/async_req.c +++ b/lib/async_req/async_req.c @@ -194,48 +194,6 @@ bool async_req_is_error(struct async_req *req, enum async_req_state *state, return true; } -static void async_req_timedout(struct tevent_context *ev, - struct tevent_timer *te, - struct timeval now, - void *priv) -{ - struct async_req *req = talloc_get_type_abort(priv, struct async_req); - TALLOC_FREE(te); - async_req_finish(req, ASYNC_REQ_TIMED_OUT); -} - -bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev, - struct timeval to) -{ - return (tevent_add_timer( - ev, req, - tevent_timeval_current_ofs(to.tv_sec, to.tv_usec), - async_req_timedout, req) - != NULL); -} - -struct async_req *async_wait_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct timeval to) -{ - struct async_req *result; - - result = async_req_new(mem_ctx); - if (result == NULL) { - return result; - } - if (!async_req_set_timeout(result, ev, to)) { - TALLOC_FREE(result); - return NULL; - } - return result; -} - -bool async_wait_recv(struct async_req *req) -{ - return true; -} - struct async_queue_entry { struct async_queue_entry *prev, *next; struct async_req_queue *queue; diff --git a/lib/async_req/async_req.h b/lib/async_req/async_req.h index fc849880cd..fdec1b708e 100644 --- a/lib/async_req/async_req.h +++ b/lib/async_req/async_req.h @@ -139,15 +139,6 @@ bool async_post_error(struct async_req *req, struct tevent_context *ev, bool async_req_is_error(struct async_req *req, enum async_req_state *state, uint64_t *error); -bool async_req_set_timeout(struct async_req *req, struct tevent_context *ev, - struct timeval to); - -struct async_req *async_wait_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct timeval to); - -bool async_wait_recv(struct async_req *req); - struct async_req_queue; struct async_req_queue *async_req_queue_init(TALLOC_CTX *mem_ctx); diff --git a/lib/replace/libreplace_network.m4 b/lib/replace/libreplace_network.m4 index 1dc1c44ed8..9223d94b75 100644 --- a/lib/replace/libreplace_network.m4 +++ b/lib/replace/libreplace_network.m4 @@ -242,7 +242,7 @@ AC_CHECK_MEMBERS([struct sockaddr.sa_len], dnl test for getifaddrs and freeifaddrs AC_CACHE_CHECK([for getifaddrs and freeifaddrs],libreplace_cv_HAVE_GETIFADDRS,[ -AC_TRY_COMPILE([ +AC_TRY_LINK([ #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> diff --git a/lib/talloc/configure.ac b/lib/talloc/configure.ac index 39cea393ce..00e8242d4e 100644 --- a/lib/talloc/configure.ac +++ b/lib/talloc/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.50) -AC_INIT(talloc, 1.2.1) +AC_INIT(talloc, 1.3.0) AC_CONFIG_SRCDIR([talloc.c]) AC_SUBST(datarootdir) AC_CONFIG_HEADER(config.h) diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h index b62393494b..5c8d5c5fe2 100644 --- a/lib/talloc/talloc.h +++ b/lib/talloc/talloc.h @@ -94,6 +94,7 @@ typedef void TALLOC_CTX; #define talloc_array(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) #define talloc_array_size(ctx, size, count) _talloc_array(ctx, size, count, __location__) #define talloc_array_ptrtype(ctx, ptr, count) (_TALLOC_TYPEOF(ptr))talloc_array_size(ctx, sizeof(*(ptr)), count) +#define talloc_array_length(ctx) ((ctx) ? talloc_get_size(ctx)/sizeof(*ctx) : 0) #define talloc_realloc(ctx, p, type, count) (type *)_talloc_realloc_array(ctx, p, sizeof(type), count, #type) #define talloc_realloc_size(ctx, ptr, size) _talloc_realloc(ctx, ptr, size, __location__) @@ -115,6 +116,8 @@ typedef void TALLOC_CTX; #define talloc_append_string(c, s, a) (s?talloc_strdup_append(s,a):talloc_strdup(c, a)) #endif +#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0) + /* The following definitions come from talloc.c */ void *_talloc(const void *context, size_t size); void *talloc_pool(const void *context, size_t size); |