if (debug) log_d("process_fd: open(\"%s\") = %d", r->path_translated, fd);
static int process_fd(struct request *r){	int fd;	if (r->path_args[0] && r->c->path_args_ok == 0 && (r->path_args[1] || r->isindex == 0)) {		r->error_file = r->c->error_404_file;		return 404;	}	if (r->method == M_POST)		return 405;	fd = open(r->path_translated, O_RDONLY | O_NONBLOCK);	if (fd == -1) {		log_d("cannot open %s", r->path_translated);		lerror("open");		r->error_file = r->c->error_404_file;		return 404;	}	if (fstat(fd, &r->finfo) == -1) {		lerror("fstat");		close(fd);		return 500;	}	if (!S_ISREG(r->finfo.st_mode)) {		log_d("process_fd: non-regular file %s", r->path_translated);		close(fd);		r->error_file = r->c->error_404_file;		return 404;	}	r->content_length = r->finfo.st_size;	r->last_modified = r->finfo.st_mtime;	if (r->last_modified <= r->ims) {		close(fd);		r->num_content = -1;		return 304;	}	if (r->method == M_GET) {		fcntl(fd, F_SETFD, FD_CLOEXEC);		r->cn->rfd = fd;	} else		close(fd);	return 200;}