ref: 248f28e276561aef4fca57bb9860bedea56f5367
parent: 20359a5043dc72907ad927bd4c4173d4c3e8b15c
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon May 18 12:02:17 EDT 2020
page: needs seeking? write to a temp file
--- a/main.c
+++ b/main.c
@@ -266,8 +266,11 @@
page(Response *r)
{
if(rfork(RFPROC|RFFDG|RFNOTEG|RFNOWAIT) == 0){
+ char tmp[32] = "/tmp/gem9XXXXXXXXXXX", *cmd;
+ mktemp(tmp);
+ cmd = smprint("cat >%s >[2]/dev/null; page -w %s; rm %s", tmp, tmp, tmp);
dup(r->fd, 0); close(r->fd);
- execl("/bin/page", "page", "-w", nil);
+ execl("/bin/rc", "rc", "-c", cmd, nil);
}
}