async_sock: try fix the source4 build on FreeBSD, Solaris, SLES8
authorStefan Metzmacher <metze@samba.org>
Mon, 8 Jun 2009 06:15:57 +0000 (08:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 8 Jun 2009 07:40:06 +0000 (09:40 +0200)
metze

lib/async_req/async_sock.c
lib/async_req/async_sock.h
lib/async_req/config.mk
nsswitch/libwbclient/wb_reqtrans.c
nsswitch/libwbclient/wbc_async.c

index 643eb2d308f5c42686f310089d5dc1c4ad599b22..cf007e17f191a5cdf7c345a8f9894a9dd05d02f9 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
-#include "lib/talloc/talloc.h"
-#include "lib/tevent/tevent.h"
+#include "replace.h"
+#include "system/network.h"
+#include "system/filesys.h"
+#include <talloc.h>
+#include <tevent.h>
 #include "lib/async_req/async_sock.h"
+
+/* Note: lib/util/ is currently GPL */
 #include "lib/util/tevent_unix.h"
-#include <fcntl.h>
+#include "lib/util/util.h"
 
 #ifndef TALLOC_FREE
 #define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
index d47be305899a9bdbed981936b2002f524117f4e3..e7ddff8c92a9cd0024203ce2cede854cef802f13 100644 (file)
@@ -24,7 +24,8 @@
 #ifndef __ASYNC_SOCK_H__
 #define __ASYNC_SOCK_H__
 
-#include "includes.h"
+#include <talloc.h>
+#include <tevent.h>
 
 struct tevent_req *async_send_send(TALLOC_CTX *mem_ctx,
                                   struct tevent_context *ev,
index 1f4b557ce44e3f291517c5fc6ae4d43929157c7c..64e537c0886d12f200a20c5b78ded17ccd93fc86 100644 (file)
@@ -1,4 +1,4 @@
 [SUBSYSTEM::LIBASYNC_REQ]
-PUBLIC_DEPENDENCIES = LIBREPLACE_NETWORK
+PUBLIC_DEPENDENCIES = LIBREPLACE_NETWORK LIBTALLOC LIBTEVENT
 
 LIBASYNC_REQ_OBJ_FILES = $(addprefix ../lib/async_req/, async_sock.o)
index 84ed7198f2f21f98f7c1734b7f37e268bf5fc3e1..5328423b15ffb5b9688dd750988153b3e87ba2f4 100644 (file)
 #include "system/network.h"
 #include <talloc.h>
 #include <tevent.h>
-struct fd_event;
-struct event_context;
 #include "lib/async_req/async_sock.h"
 #include "lib/util/tevent_unix.h"
 #include "nsswitch/winbind_struct_protocol.h"
 #include "nsswitch/libwbclient/wbclient.h"
 #include "nsswitch/libwbclient/wbc_async.h"
 
-#ifdef DBGC_CLASS
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_WINBIND
-#endif
+/* can't use DEBUG here... */
+#define DEBUG(a,b)
 
 struct req_read_state {
        struct winbindd_request *wb_req;
index 5f985f9d5acc7266a5af59841887551b75a543bc..fb8d8b102d494091bc0b8d384a9cf405a033c9af 100644 (file)
@@ -26,8 +26,6 @@
 #include "system/network.h"
 #include <talloc.h>
 #include <tevent.h>
-struct fd_event;
-struct event_context;
 #include "lib/async_req/async_sock.h"
 #include "nsswitch/winbind_struct_protocol.h"
 #include "nsswitch/libwbclient/wbclient.h"
@@ -254,7 +252,7 @@ static struct tevent_req *wb_connect_send(TALLOC_CTX *mem_ctx,
 
        /* Connect to socket */
 
-       path = talloc_asprintf(talloc_tos(), "%s/%s", dir,
+       path = talloc_asprintf(mem_ctx, "%s/%s", dir,
                               WINBINDD_SOCKET_NAME);
        if (path == NULL) {
                goto nomem;
@@ -613,7 +611,7 @@ static bool wb_trans_retry(struct tevent_req *req,
        }
 
        subreq = tevent_wakeup_send(state, state->ev,
-                                   timeval_current_ofs(1, 0));
+                                   tevent_timeval_current_ofs(1, 0));
        if (tevent_req_nomem(subreq, req)) {
                return true;
        }