diff --git a/src/client/sock.c b/src/client/sock.c
index 66b83a70009f16921ef70f8e487ae14eabe454dd..59c77873e08411b22a9c1e5a6a857a8e269210f5 100644 (file)
--- a/src/client/sock.c
+++ b/src/client/sock.c
return 0;
} /* sdb_client_connect */
+int
+sdb_client_sockfd(sdb_client_t *client)
+{
+ if (! client)
+ return -1;
+ return client->fd;
+} /* sdb_client_sockfd */
+
void
sdb_client_close(sdb_client_t *client)
{
size_t data_offset = sdb_strbuf_len(buf);
+ if (code)
+ *code = UINT32_MAX;
+
if ((! client) || (! client->fd) || (! buf)) {
errno = EBADF;
return -1;
}
- if (code)
- *code = UINT32_MAX;
-
while (42) {
ssize_t status;
- /* XXX: use select */
+ if (sdb_proto_select(client->fd, SDB_PROTO_SELECTIN))
+ return -1;
errno = 0;
status = sdb_strbuf_read(buf, client->fd, req);