diff options
Diffstat (limited to 'mbbsd/chc_net.c')
-rw-r--r-- | mbbsd/chc_net.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/mbbsd/chc_net.c b/mbbsd/chc_net.c index b9f63d8f..ba52bf26 100644 --- a/mbbsd/chc_net.c +++ b/mbbsd/chc_net.c @@ -1,21 +1,25 @@ -/* $Id: chc_net.c,v 1.2 2002/06/04 13:08:33 in2 Exp $ */ +/* $Id: chc_net.c,v 1.3 2002/07/05 17:10:27 in2 Exp $ */ #include "bbs.h" typedef struct drc_t { - rc_t from, to; -} drc_t; + rc_t from, to; +} drc_t; -int chc_recvmove(int s) { - drc_t buf; +int +chc_recvmove(int s) +{ + drc_t buf; - if(read(s, &buf, sizeof(buf)) != sizeof(buf)) + if (read(s, &buf, sizeof(buf)) != sizeof(buf)) return 1; chc_from = buf.from, chc_to = buf.to; return 0; } -void chc_sendmove(int s) { - drc_t buf; - +void +chc_sendmove(int s) +{ + drc_t buf; + buf.from = chc_from, buf.to = chc_to; write(s, &buf, sizeof(buf)); } |