blob: 5a992e731f010a4bb3763d8f38f93080fb9da642 [file] [log] [blame]
rsc056fe1b2003-11-23 18:19:58 +00001#include <u.h>
2#include <libc.h>
3#include <venti.h>
4#include "queue.h"
5
6void
7vthangup(VtConn *z)
8{
9 qlock(&z->lk);
10 z->state = VtStateClosed;
11 if(z->infd >= 0)
12 close(z->infd);
13 if(z->outfd >= 0 && z->outfd != z->infd)
14 close(z->outfd);
15 z->infd = -1;
16 z->outfd = -1;
17 if(z->writeq)
18 _vtqhangup(z->writeq);
19 if(z->readq)
20 _vtqhangup(z->readq);
21 qunlock(&z->lk);
22}