tsocket: move tsocket_simple_int_recv() to tsocket.c
authorStefan Metzmacher <metze@samba.org>
Fri, 3 Apr 2009 15:54:08 +0000 (17:54 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 May 2009 15:38:27 +0000 (17:38 +0200)
metze

lib/tsocket/tsocket.c
lib/tsocket/tsocket_helpers.c

index 55a7f032066d3391b27da1c91669d62da654babc..dbac6e26cf896eeb0e98a7a2c0f497a4e981e857 100644 (file)
 */
 
 #include "replace.h"
-#include "system/network.h"
 #include "tsocket.h"
 #include "tsocket_internal.h"
 
+int tsocket_simple_int_recv(struct tevent_req *req, int *perrno)
+{
+       enum tevent_req_state state;
+       uint64_t error;
+
+       if (!tevent_req_is_error(req, &state, &error)) {
+               return 0;
+       }
+
+       switch (state) {
+       case TEVENT_REQ_NO_MEMORY:
+               *perrno = ENOMEM;
+               return -1;
+       case TEVENT_REQ_TIMED_OUT:
+               *perrno = ETIMEDOUT;
+               return -1;
+       case TEVENT_REQ_USER_ERROR:
+               *perrno = (int)error;
+               return -1;
+       default:
+               *perrno = EIO;
+               return -1;
+       }
+
+       *perrno = EIO;
+       return -1;
+}
+
 struct tsocket_address *_tsocket_address_create(TALLOC_CTX *mem_ctx,
                                                const struct tsocket_address_ops *ops,
                                                void *pstate,
index eb506fef16f628e2883ff52c9016a07569ad3601..1876dc3882f75f67d173dcf9b7fadfd049f3f7ea 100644 (file)
 */
 
 #include "replace.h"
-#include "system/network.h"
-#include "system/filesys.h"
 #include "tsocket.h"
 #include "tsocket_internal.h"
 
-int tsocket_simple_int_recv(struct tevent_req *req, int *perrno)
-{
-       enum tevent_req_state state;
-       uint64_t error;
-
-       if (!tevent_req_is_error(req, &state, &error)) {
-               return 0;
-       }
-
-       switch (state) {
-       case TEVENT_REQ_NO_MEMORY:
-               *perrno = ENOMEM;
-               return -1;
-       case TEVENT_REQ_TIMED_OUT:
-               *perrno = ETIMEDOUT;
-               return -1;
-       case TEVENT_REQ_USER_ERROR:
-               *perrno = (int)error;
-               return -1;
-       default:
-               *perrno = EIO;
-               return -1;
-       }
-
-       *perrno = EIO;
-       return -1;
-}
-
 struct tdgram_sendto_queue_state {
        /* this structs are owned by the caller */
        struct {