~ft/gemnine

248f28e276561aef4fca57bb9860bedea56f5367 — Sigrid Haflínudóttir 2 years ago 20359a5
page: needs seeking? write to a temp file
1 files changed, 4 insertions(+), 1 deletions(-)

M main.c
M main.c => main.c +4 -1
@@ 266,8 266,11 @@ void
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);
	}
}