summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio/fsys.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-10-21 17:00:12 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-10-21 17:00:12 +0200
commitbf13408df23bb1fe92d6aaf81ff45044d3e1d1f7 (patch)
tree636bcc854a3bb1a82655b5fe17cfc5820edb9dc6 /sys/src/cmd/rio/fsys.c
parent5374d09d35ee47ae73bc17fa363c270c2c141315 (diff)
rio: various fixes
use notefd in killprocs() insead of postnote() as the process might'v exited. the notefd stays valid even if the particular process it was originaly opend on exited. remove the Window.pid field as its not needed. dup() the notefd for interruptproc as the window might'v gone away and closed the notefd file descriptor, resulting in us writing to the wrong thing. use snprint() instead of sprint() for safety. fix bogus debug fprint(). add missing "visible" flushimage() after Reshaped winctl message got handled. i assumed wsetname()/nameimage() would be enough, it but does a invisible flush so softscreen doesnt get updated immidiately. do not make allocimage() failure in scrtemps() fatal. it wont draw the window properly, but it gives the user a chance to delete some windows to recover.
Diffstat (limited to 'sys/src/cmd/rio/fsys.c')
-rw-r--r--sys/src/cmd/rio/fsys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/cmd/rio/fsys.c b/sys/src/cmd/rio/fsys.c
index b141055d3..1676ef1f9 100644
--- a/sys/src/cmd/rio/fsys.c
+++ b/sys/src/cmd/rio/fsys.c
@@ -96,7 +96,7 @@ post(char *name, char *envname, int srvfd)
fd = create(name, OWRITE|ORCLOSE|OCEXEC, 0600);
if(fd < 0)
error(name);
- sprint(buf, "%d",srvfd);
+ snprint(buf, sizeof(buf), "%d", srvfd);
if(write(fd, buf, strlen(buf)) != strlen(buf))
error("srv write");
putenv(envname, name);
@@ -150,7 +150,7 @@ filsysinit(Channel *cxfidalloc)
*/
if(cexecpipe(&p0, &wctlfd) < 0)
goto Rescue;
- sprint(srvwctl, "/srv/riowctl.%s.%d", fs->user, pid);
+ snprint(srvwctl, sizeof(srvwctl), "/srv/riowctl.%s.%d", fs->user, pid);
post(srvwctl, "wctl", p0);
close(p0);
@@ -167,7 +167,7 @@ filsysinit(Channel *cxfidalloc)
/*
* Post srv pipe
*/
- sprint(srvpipe, "/srv/rio.%s.%d", fs->user, pid);
+ snprint(srvpipe, sizeof(srvpipe), "/srv/rio.%s.%d", fs->user, pid);
post(srvpipe, "wsys", fs->cfd);
return fs;
@@ -537,7 +537,7 @@ filsysread(Filsys *fs, Xfid *x, Fid *f)
int i, n, o, e, len, j, k, *ids;
Dirtab *d, dt;
uint clock;
- char buf[16];
+ char buf[32];
if((f->qid.type & QTDIR) == 0){
sendp(x->c, xfidread);