diff options
author | rsc <devnull@localhost> | 2004-10-17 04:18:55 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-10-17 04:18:55 +0000 |
commit | c3e73c01e301ca83fa9ab9bcf1b579f996b12835 (patch) | |
tree | c704d725997bb9b04a33b64e65657510c939e354 /src/cmd/9term | |
parent | 42c3794c5c073b6ef22671ef4aca16428d3894aa (diff) | |
download | plan9port-c3e73c01e301ca83fa9ab9bcf1b579f996b12835.tar.gz plan9port-c3e73c01e301ca83fa9ab9bcf1b579f996b12835.tar.bz2 plan9port-c3e73c01e301ca83fa9ab9bcf1b579f996b12835.zip |
remove socket at exit
Diffstat (limited to 'src/cmd/9term')
-rw-r--r-- | src/cmd/9term/9term.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index 5af25469..91771278 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -156,6 +156,7 @@ int label(Rune*, int); char wdir[1024]; char childwdir[1024]; void hangupnote(void*, char*); +char thesocket[100]; char *menu2str[] = { "cut", @@ -1845,6 +1846,14 @@ char adir[100]; int afd; void +removethesocket(void) +{ + if(thesocket[0]) + if(remove(thesocket) < 0) + fprint(2, "remove %s: %r\n", thesocket); +} + +void servedevtext(void) { char buf[100]; @@ -1858,6 +1867,8 @@ servedevtext(void) putenv("text9term", buf); threadcreate(listenthread, nil, STACK); + strcpy(thesocket, buf+5); + atexit(removethesocket); } void |