31 lines · 547 B · C
RawDownload
#include <u.h>#ifdef PLAN9PORT#include <sys/socket.h>#endif#include <libc.h>#include <venti.h>#include "queue.h" voidvthangup(VtConn *z){	qlock(&z->lk);	z->state = VtStateClosed;#ifdef PLAN9PORT	/* try to make the read in vtrecvproc fail */	shutdown(SHUT_WR, z->infd);	shutdown(SHUT_WR, z->outfd);#endif	if(z->infd >= 0)		close(z->infd);	if(z->outfd >= 0 && z->outfd != z->infd)		close(z->outfd);	z->infd = -1;	z->outfd = -1;	if(z->writeq)		_vtqhangup(z->writeq);	if(z->readq)		_vtqhangup(z->readq);	qunlock(&z->lk);} 

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t