aboutsummaryrefslogtreecommitdiff
path: root/src/libthread
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-02-09 19:33:05 +0000
committerrsc <devnull@localhost>2004-02-09 19:33:05 +0000
commitd51419bf4397cf13d0c50bf84c125477c6bed307 (patch)
treed9a10c72e5b710e7a9f85e632c8b893ecd43dd0a /src/libthread
parentc1973705501d05e906bd14a0dc25cc4472b5871f (diff)
downloadplan9port-d51419bf4397cf13d0c50bf84c125477c6bed307.tar.gz
plan9port-d51419bf4397cf13d0c50bf84c125477c6bed307.tar.bz2
plan9port-d51419bf4397cf13d0c50bf84c125477c6bed307.zip
various tweaks.
Diffstat (limited to 'src/libthread')
-rw-r--r--src/libthread/iocall.c5
-rw-r--r--src/libthread/iodial.c7
-rw-r--r--src/libthread/iowrite.c7
-rw-r--r--src/libthread/mkfile2
-rw-r--r--src/libthread/note.c2
5 files changed, 16 insertions, 7 deletions
diff --git a/src/libthread/iocall.c b/src/libthread/iocall.c
index d9cf9d04..0577f8a0 100644
--- a/src/libthread/iocall.c
+++ b/src/libthread/iocall.c
@@ -3,6 +3,7 @@
long
iocall(Ioproc *io, long (*op)(va_list*), ...)
{
+ char e[ERRMAX];
int ret, inted;
Ioproc *msg;
@@ -39,11 +40,13 @@ iocall(Ioproc *io, long (*op)(va_list*), ...)
va_end(io->arg);
ret = io->ret;
if(ret < 0)
- errstr(io->err, sizeof io->err);
+ strecpy(e, e+sizeof e, io->err);
io->inuse = 0;
/* release resources */
while(send(io->creply, &io) == -1)
;
+ if(ret < 0)
+ errstr(e, sizeof e);
return ret;
}
diff --git a/src/libthread/iodial.c b/src/libthread/iodial.c
index 8171156c..2e45cfe6 100644
--- a/src/libthread/iodial.c
+++ b/src/libthread/iodial.c
@@ -4,14 +4,17 @@ static long
_iodial(va_list *arg)
{
char *addr, *local, *dir;
- int *cdfp;
+ int *cdfp, fd;
addr = va_arg(*arg, char*);
local = va_arg(*arg, char*);
dir = va_arg(*arg, char*);
cdfp = va_arg(*arg, int*);
- return dial(addr, local, dir, cdfp);
+fprint(2, "before dial\n");
+ fd = dial(addr, local, dir, cdfp);
+fprint(2, "after dial\n");
+ return fd;
}
int
diff --git a/src/libthread/iowrite.c b/src/libthread/iowrite.c
index 664a84bf..593224c2 100644
--- a/src/libthread/iowrite.c
+++ b/src/libthread/iowrite.c
@@ -5,13 +5,14 @@ _iowrite(va_list *arg)
{
int fd;
void *a;
- long n;
+ long n, nn;
fd = va_arg(*arg, int);
a = va_arg(*arg, void*);
n = va_arg(*arg, long);
- n = write(fd, a, n);
- return n;
+ nn = write(fd, a, n);
+fprint(2, "_iowrite %d %d %r\n", n, nn);
+ return nn;
}
long
diff --git a/src/libthread/mkfile b/src/libthread/mkfile
index 739aaf84..8854cde7 100644
--- a/src/libthread/mkfile
+++ b/src/libthread/mkfile
@@ -16,10 +16,12 @@ OFILES=\
id.$O\
iocall.$O\
ioclose.$O\
+ iodial.$O\
ioopen.$O\
ioproc.$O\
ioread.$O\
ioreadn.$O\
+ iosleep.$O\
iowrite.$O\
kill.$O\
lib.$O\
diff --git a/src/libthread/note.c b/src/libthread/note.c
index b25f2b23..1136156c 100644
--- a/src/libthread/note.c
+++ b/src/libthread/note.c
@@ -92,7 +92,7 @@ _threadnote(void *v, char *s)
// _exits(_threadexitsallstatus);
// }
- if(strcmp(s, "threadint")==0)
+ if(strcmp(s, "threadint")==0 || strcmp(s, "interrupt")==0)
noted(NCONT);
p = _threadgetproc();