texit correctly - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit b10db40d3b82f192cc04b70305e4ec24109edf46
(DIR) parent 28aaab76cffd50db867f8aec2c35e4244ea196f5
(HTM) Author: rsc <devnull@localhost>
Date: Tue, 4 Jan 2005 22:17:00 +0000
exit correctly
Diffstat:
M src/cmd/plumb/plumb.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
(DIR) diff --git a/src/cmd/plumb/plumb.c b/src/cmd/plumb/plumb.c
t@@ -10,7 +10,7 @@ void
usage(void)
{
fprint(2, "usage: plumb [-p plumbfile] [-a 'attr=value ...'] [-s src] [-d dst] [-t type] [-w wdir] -i | data1\n");
- exits("usage");
+ threadexitsall("usage");
}
void
t@@ -25,14 +25,14 @@ gather(void)
m.data = realloc(m.data, m.ndata+n);
if(m.data == nil){
fprint(2, "plumb: alloc failed: %r\n");
- exits("alloc");
+ threadexitsall("alloc");
}
memmove(m.data+m.ndata, buf, n);
m.ndata += n;
}
if(n < 0){
fprint(2, "plumb: i/o error on input: %r\n");
- exits("read");
+ threadexitsall("read");
}
}
t@@ -94,7 +94,7 @@ threadmain(int argc, char *argv[])
fd = plumbopen("send", OWRITE);
if(fd < 0){
fprint(2, "plumb: can't open plumb file: %r\n");
- exits("open");
+ threadexitsall("open");
}
if(input){
gather();
t@@ -102,9 +102,9 @@ threadmain(int argc, char *argv[])
m.attr = plumbaddattr(m.attr, plumbunpackattr("action=showdata"));
if(plumbsend(fd, &m) < 0){
fprint(2, "plumb: can't send message: %r\n");
- exits("error");
+ threadexitsall("error");
}
- exits(nil);
+ threadexitsall(nil);
}
for(i=0; i<argc; i++){
if(input == 0){
t@@ -113,7 +113,7 @@ threadmain(int argc, char *argv[])
}
if(plumbsend(fd, &m) < 0){
fprint(2, "plumb: can't send message: %r\n");
- exits("error");
+ threadexitsall("error");
}
}
threadexitsall(nil);