if (debug) log_d("process_dump: close(%d) = %d", fd, rv);
int process_dump(struct request *r){	int fd, rv;	char tmpbuf[32];	if (r->method != M_GET && r->method != M_HEAD)		return 405;	if (r->path_args[0]) {		log_d("process_dump: no crap");		r->error_file = r->c->error_404_file;		return 404;	}	strcpy(tmpbuf, "/tmp/mathop-dump.XXXXXXXX");	fd = mkstemp(tmpbuf);	if (fd == -1) {		lerror("mkstemp");		return 500;	}	if (debug)		log_d("process_dump: mkstemp(\"%s\") = %d", tmpbuf, fd);	if (do_dump(fd, tmpbuf, r) == -1) {		rv = close(fd);		if (debug)			log_d("process_dump: close(%d) = %d", fd, rv);		return 500;	}	r->content_length = r->finfo.st_size;	r->last_modified = r->finfo.st_mtime;	if (r->method == M_GET) {		rv = lseek(fd, 0, SEEK_SET);		if (debug)			log_d("process_dump: lseek(%d, 0, SEEK_SET) = %d", fd, rv);		r->cn->rfd = fd;	} else {		rv = close(fd);		if (debug)			log_d("process_dump: close(%d) = %d", fd, rv);	}	r->content_type = "text/plain";	r->num_content = 0;	return 200;}