summaryrefslogtreecommitdiffstats
path: root/server/util
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-02-25 16:40:17 -0500
committerSimo Sorce <ssorce@redhat.com>2009-02-26 09:13:20 -0500
commitc9f6d2795fde2f9bf80277d425df2b44bc860226 (patch)
tree301e1217eb5fda73351e9c7fb2f73048853942df /server/util
parent03fa4034a6a74a326e5340dae42d85eea4516b3c (diff)
downloadsssd-c9f6d2795fde2f9bf80277d425df2b44bc860226.tar.gz
sssd-c9f6d2795fde2f9bf80277d425df2b44bc860226.tar.xz
sssd-c9f6d2795fde2f9bf80277d425df2b44bc860226.zip
Rebase the code to use talloc, tdb, tevent, ldb as external
dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library.
Diffstat (limited to 'server/util')
-rw-r--r--server/util/btreemap.c1
-rw-r--r--server/util/memory.c1
-rw-r--r--server/util/server.c21
-rw-r--r--server/util/signal.c1
-rw-r--r--server/util/util.h10
5 files changed, 18 insertions, 16 deletions
diff --git a/server/util/btreemap.c b/server/util/btreemap.c
index 9eed2eb..c9289f5 100644
--- a/server/util/btreemap.c
+++ b/server/util/btreemap.c
@@ -19,6 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
#include "talloc.h"
#include "util/btreemap.h"
#include "util/util.h"
diff --git a/server/util/memory.c b/server/util/memory.c
index a25aa78..87fefd2 100644
--- a/server/util/memory.c
+++ b/server/util/memory.c
@@ -1,4 +1,3 @@
-#include "replace.h"
#include "talloc.h"
/*
diff --git a/server/util/server.c b/server/util/server.c
index 35e72fa..86854cb 100644
--- a/server/util/server.c
+++ b/server/util/server.c
@@ -24,16 +24,12 @@
*/
#define _GNU_SOURCE
-#include <stdio.h>
-#include <stdbool.h>
-#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include "tevent.h"
+#include "util/util.h"
#include "ldb.h"
#include "confdb/confdb.h"
-#include "util/util.h"
/*******************************************************************
Close the low 3 fd's and open dev/null in their place.
@@ -215,8 +211,9 @@ static void setup_signals(void)
/*
handle io on stdin
*/
-static void server_stdin_handler(struct event_context *event_ctx, struct fd_event *fde,
- uint16_t flags, void *private)
+static void server_stdin_handler(struct tevent_context *event_ctx,
+ struct tevent_fd *fde,
+ uint16_t flags, void *private)
{
const char *binary_name = (const char *)private;
uint8_t c;
@@ -237,7 +234,7 @@ static void server_stdin_handler(struct event_context *event_ctx, struct fd_even
int server_setup(const char *name, int flags,
struct main_context **main_ctx)
{
- struct event_context *event_ctx;
+ struct tevent_context *event_ctx;
struct main_context *ctx;
uint16_t stdin_event_flags;
char *conf_db;
@@ -271,7 +268,7 @@ int server_setup(const char *name, int flags,
/* the event context is the top level structure.
* Everything else should hang off that */
- event_ctx = event_context_init(talloc_autofree_context());
+ event_ctx = tevent_context_init(talloc_autofree_context());
if (event_ctx == NULL) {
DEBUG(0,("The event context initialiaziton failed\n"));
return 1;
@@ -300,7 +297,7 @@ int server_setup(const char *name, int flags,
if (flags & FLAGS_INTERACTIVE) {
/* terminate when stdin goes away */
- stdin_event_flags = EVENT_FD_READ;
+ stdin_event_flags = TEVENT_FD_READ;
} else {
/* stay alive forever */
stdin_event_flags = 0;
@@ -310,7 +307,7 @@ int server_setup(const char *name, int flags,
#ifdef SIGTTIN
signal(SIGTTIN, SIG_IGN);
#endif
- event_add_fd(event_ctx, event_ctx, 0, stdin_event_flags,
+ tevent_add_fd(event_ctx, event_ctx, 0, stdin_event_flags,
server_stdin_handler, discard_const(name));
*main_ctx = ctx;
@@ -321,7 +318,7 @@ void server_loop(struct main_context *main_ctx)
{
/* wait for events - this is where the server sits for most of its
life */
- event_loop_wait(main_ctx->event_ctx);
+ tevent_loop_wait(main_ctx->event_ctx);
/* as everything hangs off this event context, freeing it
should initiate a clean shutdown of all services */
diff --git a/server/util/signal.c b/server/util/signal.c
index 5d036a3..e4a782d 100644
--- a/server/util/signal.c
+++ b/server/util/signal.c
@@ -18,7 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
#include "util/util.h"
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/server/util/util.h b/server/util/util.h
index 7388feb..c784bf5 100644
--- a/server/util/util.h
+++ b/server/util/util.h
@@ -2,9 +2,15 @@
#define __SSSD_UTIL_H__
#include <stdio.h>
+#include <stdint.h>
#include <stdbool.h>
-#include "replace.h"
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include "config.h"
#include "talloc.h"
+#include "tevent.h"
extern const char *debug_prg_name;
extern int debug_level;
@@ -42,7 +48,7 @@ void debug_fn(const char *format, ...);
#define FLAGS_PID_FILE 0x0004
struct main_context {
- struct event_context *event_ctx;
+ struct tevent_context *event_ctx;
struct confdb_ctx *confdb_ctx;
};