mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
added event context
(This used to be ctdb commit 3c9d5aba205c97ef2698567e42ed49cadf8137f2)
This commit is contained in:
parent
84ff6b1731
commit
767dec9f62
@ -33,11 +33,12 @@ struct ctdb_call {
|
||||
#define CTDB_ERR_INVALID 1
|
||||
#define CTDB_ERR_NOMEM 2
|
||||
|
||||
struct event_context;
|
||||
|
||||
/*
|
||||
initialise ctdb subsystem
|
||||
*/
|
||||
struct ctdb_context *ctdb_init(TALLOC_CTX *mem_ctx);
|
||||
struct ctdb_context *ctdb_init(struct event_context *ev);
|
||||
|
||||
/*
|
||||
tell ctdb what address to listen on, in transport specific format
|
||||
|
@ -35,11 +35,13 @@
|
||||
and to simplify the code.
|
||||
*/
|
||||
|
||||
struct ctdb_context *ctdb_init(TALLOC_CTX *mem_ctx)
|
||||
struct ctdb_context *ctdb_init(struct event_context *ev)
|
||||
{
|
||||
struct ctdb_context *ctdb;
|
||||
|
||||
ctdb = talloc_zero(mem_ctx, struct ctdb_context);
|
||||
ctdb = talloc_zero(ev, struct ctdb_context);
|
||||
ctdb->ev = ev;
|
||||
|
||||
return ctdb;
|
||||
}
|
||||
|
||||
|
@ -18,11 +18,9 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "replace.h"
|
||||
#include "includes.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "system/filesys.h"
|
||||
#include "tdb.h"
|
||||
#include "talloc.h"
|
||||
#include "ctdb.h"
|
||||
#include "popt.h"
|
||||
|
||||
enum my_functions {FUNC_SORT=1, FUNC_FETCH=2};
|
||||
@ -88,6 +86,7 @@ int main(int argc, const char *argv[])
|
||||
int i, ret;
|
||||
TDB_DATA key, data;
|
||||
poptContext pc;
|
||||
struct event_context *ev;
|
||||
|
||||
pc = poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
|
||||
|
||||
@ -112,8 +111,10 @@ int main(int argc, const char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ev = event_context_init(NULL);
|
||||
|
||||
/* initialise ctdb */
|
||||
ctdb = ctdb_init(NULL);
|
||||
ctdb = ctdb_init(ev);
|
||||
if (ctdb == NULL) {
|
||||
printf("Failed to init ctdb\n");
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user