summaryrefslogtreecommitdiff
path: root/lib/tsocket
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-04-03 17:54:08 +0200
committerStefan Metzmacher <metze@samba.org>2009-05-01 17:38:27 +0200
commitb46599590f0b2801e1658dc32b6c074d5a14828c (patch)
tree11f011ea4c257a9390dd3078b6b8585aa66dca33 /lib/tsocket
parent0db3b944bd4720be0ea66b2033ce7fd4eb27027f (diff)
downloadsamba-b46599590f0b2801e1658dc32b6c074d5a14828c.tar.gz
tsocket: move tsocket_simple_int_recv() to tsocket.c
metze
Diffstat (limited to 'lib/tsocket')
-rw-r--r--lib/tsocket/tsocket.c29
-rw-r--r--lib/tsocket/tsocket_helpers.c30
2 files changed, 28 insertions, 31 deletions
diff --git a/lib/tsocket/tsocket.c b/lib/tsocket/tsocket.c
index 55a7f032066..dbac6e26cf8 100644
--- a/lib/tsocket/tsocket.c
+++ b/lib/tsocket/tsocket.c
@@ -22,10 +22,37 @@
*/
#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,
diff --git a/lib/tsocket/tsocket_helpers.c b/lib/tsocket/tsocket_helpers.c
index eb506fef16f..1876dc3882f 100644
--- a/lib/tsocket/tsocket_helpers.c
+++ b/lib/tsocket/tsocket_helpers.c
@@ -22,39 +22,9 @@
*/
#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 {