]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - libcharybdis/commio.c
dlink -> rb_dlink
[irc/rqf/shadowircd.git] / libcharybdis / commio.c
index ac09126ceea0d8b7c2901b5a58672bfa6980f0f5..c7dfe1a4b9de3b69c0b02c12d3cf33e6457afe74 100644 (file)
@@ -58,6 +58,26 @@ static void comm_connect_dns_callback(void *vptr, struct DNSReply *reply);
 static PF comm_connect_tryconnect;
 static int comm_max_connections = 0;
 
+static int
+comm_read_raw(fde_t *F, void *buf, size_t count)
+{
+       s_assert(F != NULL);
+       s_assert(buf != NULL);
+       s_assert(count > 0);
+
+       return read(F->fd, buf, count);
+}
+
+static int
+comm_write_raw(fde_t *F, const void *buf, size_t count)
+{
+       s_assert(F != NULL);
+       s_assert(buf != NULL);
+       s_assert(count > 0);
+
+       return write(F->fd, buf, count);
+}
+
 inline fde_t *
 comm_locate_fd(int fd)
 {
@@ -88,8 +108,8 @@ comm_add_fd(int fd)
        F = MyMalloc(sizeof(fde_t));
        F->fd = fd;
 
-       F->read_impl = read;
-       F->write_impl = write;
+       F->read_impl = comm_read_raw;
+       F->write_impl = comm_write_raw;
 
        list = &fd_table[fd % FD_HASH_SIZE];
        dlinkAdd(F, &F->node, list);