diff --git a/sys/src/cmd/execnet/client.c b/sys/src/cmd/execnet/client.c index 0b90c181c..ebd723d5c 100644 --- a/sys/src/cmd/execnet/client.c +++ b/sys/src/cmd/execnet/client.c @@ -215,11 +215,9 @@ readthread(void *a) Client *c; Ioproc *io; Msg *m; - char tmp[32]; c = a; - snprint(tmp, sizeof tmp, "read%d", c->num); - threadsetname(tmp); + threadsetname("read%d", c->num); buf = emalloc(8192); io = c->readerproc; @@ -279,11 +277,9 @@ writethread(void *a) Ioproc *io; Req *r; Client *c; - char tmp[32]; c = a; - snprint(tmp, sizeof tmp, "write%d", c->num); - threadsetname(tmp); + threadsetname("write%d", c->num); buf = emalloc(8192); io = c->writerproc; @@ -320,11 +316,9 @@ execproc(void *a) { int i, fd; Client *c; - char tmp[32]; c = a; - snprint(tmp, sizeof tmp, "execproc%d", c->num); - threadsetname(tmp); + threadsetname("execproc%d", c->num); if(pipe(c->fd) < 0){ rerrstr(c->err, sizeof c->err); sendul(c->execpid, -1); @@ -346,11 +340,9 @@ execthread(void *a) { Client *c; int p; - char tmp[32]; c = a; - snprint(tmp, sizeof tmp, "exec%d", c->num); - threadsetname(tmp); + threadsetname("exec%d", c->num); c->execpid = chancreate(sizeof(ulong), 0); proccreate(execproc, c, STACK); p = recvul(c->execpid); diff --git a/sys/src/cmd/ip/tftpfs.c b/sys/src/cmd/ip/tftpfs.c index 2b5aac59e..ed7c70e05 100644 --- a/sys/src/cmd/ip/tftpfs.c +++ b/sys/src/cmd/ip/tftpfs.c @@ -171,7 +171,7 @@ download(void *aux) if((c = f->c) == nil) goto out; - threadsetname(f->path); + threadsetname("%s", f->path); snprint(buf, sizeof(buf), "%s/udp!*!0", net); if((cfd = announce(buf, adir)) < 0){ diff --git a/sys/src/cmd/nusb/joy/joy.c b/sys/src/cmd/nusb/joy/joy.c index d63199b62..cf9b093d7 100644 --- a/sys/src/cmd/nusb/joy/joy.c +++ b/sys/src/cmd/nusb/joy/joy.c @@ -228,14 +228,6 @@ setproto(KDev *f, int eid) return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, id, nil, 0); } -static void -kbprocname(KDev *kd, char *name) -{ - char buf[128]; - snprint(buf, sizeof(buf), "%s %s", name, kd->ep->dir); - threadsetname(buf); -} - static void sethipri(void) { @@ -324,7 +316,7 @@ joywork(void *a) Joy p; u64int lastb; - kbprocname(f, "joy"); + threadsetname("joy %s", f->ep->dir); sethipri(); memset(&p, 0, sizeof(p)); diff --git a/sys/src/cmd/nusb/kb/kb.c b/sys/src/cmd/nusb/kb/kb.c index 148cc8e53..73cb52a41 100644 --- a/sys/src/cmd/nusb/kb/kb.c +++ b/sys/src/cmd/nusb/kb/kb.c @@ -336,14 +336,6 @@ kbfatal(KDev *kd, char *sts) threadexits(sts); } -static void -kbprocname(KDev *kd, char *name) -{ - char buf[128]; - snprint(buf, sizeof(buf), "%s %s", name, kd->ep->dir); - threadsetname(buf); -} - static void sethipri(void) { @@ -465,7 +457,7 @@ ptrwork(void* a) KDev* f = a; Ptr p; - kbprocname(f, "ptr"); + threadsetname("ptr %s", f->ep->dir); sethipri(); memset(&p, 0, sizeof(p)); @@ -698,7 +690,7 @@ kbdwork(void *a) char err[128]; KDev *f = a; - kbprocname(f, "kbd"); + threadsetname("kbd %s", f->ep->dir); f->repeatc = chancreate(sizeof(ulong), 0); if(f->repeatc == nil) diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index fb117b614..9b1fff188 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -180,12 +180,11 @@ winctl(void *arg) Stringpair pair; Wctlmesg wcm; Completion *cr; - char buf[4*12+1], *kbdq[8], *kbds; + char *kbdq[8], *kbds; int kbdqr, kbdqw; w = arg; - snprint(buf, sizeof buf, "winctl-id%d", w->id); - threadsetname(buf); + threadsetname("winctl-id%d", w->id); mrm.cm = chancreate(sizeof(Mouse), 0); krm.ck = chancreate(sizeof(char*), 0); @@ -540,11 +539,9 @@ completeproc(void *arg) { Completejob *job; Completion *c; - char buf[128]; job = arg; - snprint(buf, sizeof(buf), "namecomplete %s", job->dir); - threadsetname(buf); + threadsetname("namecomplete %s", job->dir); c = complete(job->dir, job->str); if(c != nil && sendp(job->win->complete, c) <= 0) diff --git a/sys/src/cmd/rio/xfid.c b/sys/src/cmd/rio/xfid.c index adae440cf..a66c94d58 100644 --- a/sys/src/cmd/rio/xfid.c +++ b/sys/src/cmd/rio/xfid.c @@ -99,11 +99,9 @@ xfidctl(void *arg) { Xfid *x; void (*f)(Xfid*); - char buf[64]; x = arg; - snprint(buf, sizeof buf, "xfid.%p", x); - threadsetname(buf); + threadsetname("xfid.%p", x); for(;;){ f = recvp(x->c); if(f){ diff --git a/sys/src/libcontrol/control.c b/sys/src/libcontrol/control.c index f30d6fe57..62a441524 100644 --- a/sys/src/libcontrol/control.c +++ b/sys/src/libcontrol/control.c @@ -160,12 +160,11 @@ controlsetthread(void *v) Control *f; int prevbut, n, i; Alt alts[NALT+1]; - char tmp[64], *str; + char *str; Rune buf[2][20], *rp; cs = v; - snprint(tmp, sizeof tmp, "controlsetthread 0x%p", cs); - threadsetname(tmp); + threadsetname("controlsetthread 0x%p", cs); alts[AKey].c = cs->kbdc; alts[AKey].v = &rp; @@ -619,12 +618,10 @@ static void resizethread(void *v) { Controlset *cs; - char buf[64]; Alt alts[3]; cs = v; - snprint(buf, sizeof buf, "resizethread0x%p", cs); - threadsetname(buf); + threadsetname("resizethread 0x%p", cs); alts[0].c = cs->resizec; alts[0].v = nil;