diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-10-04 21:11:56 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-10-04 21:11:56 +0200 |
commit | 6187e219da80ed8d75c717cd5f7c2f10326c5a81 (patch) | |
tree | ffaacc9e80f6cda4a8b04df5f0a2e5949a33eae9 /sys/src/cmd/mothra/getpix.c | |
parent | 0b42409cf44168a945cfa5080f71b61be618beb9 (diff) |
mothra: avoid intermediate rc shell processes, use rfork(RFREND) to isolate rendezvous group
Diffstat (limited to 'sys/src/cmd/mothra/getpix.c')
-rw-r--r-- | sys/src/cmd/mothra/getpix.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/src/cmd/mothra/getpix.c b/sys/src/cmd/mothra/getpix.c index 9a56c8a44..5dd31bb01 100644 --- a/sys/src/cmd/mothra/getpix.c +++ b/sys/src/cmd/mothra/getpix.c @@ -28,7 +28,7 @@ void getimage(Rtext *t, Www *w){ Url url; Image *b; int fd, typ; - char err[512]; + char err[512], buf[80], *s; Pix *p; ap=t->user; @@ -54,19 +54,16 @@ void getimage(Rtext *t, Www *w){ werrstr("unknown image type"); goto Err; } - if((fd = pipeline(pixcmd[typ], fd)) < 0) + if((fd = pipeline(fd, "exec %s", pixcmd[typ])) < 0) goto Err; if(ap->width>0 || ap->height>0){ - char buf[80]; - char *p; - - p = buf; - p += sprint(p, "resize"); + s = buf; + s += sprint(s, "exec resize"); if(ap->width>0) - p += sprint(p, " -x %d", ap->width); + s += sprint(s, " -x %d", ap->width); if(ap->height>0) - p += sprint(p, " -y %d", ap->height); - if((fd = pipeline(buf, fd)) < 0) + s += sprint(s, " -y %d", ap->height); + if((fd = pipeline(fd, buf)) < 0) goto Err; } b=readimage(display, fd, 1); |