[Tarantool-patches] [PATCH v6 2/4] popen: Introduce a backend engine

Konstantin Osipov kostja.osipov at gmail.com
Thu Dec 26 10:14:41 MSK 2019


* Cyrill Gorcunov <gorcunov at gmail.com> [19/12/17 15:57]:
> +ssize_t
> +popen_read_timeout(struct popen_handle *handle, void *buf,
> +		   size_t count, unsigned int flags,
> +		   ev_tstamp timeout)
> +{
> +	int idx = flags & POPEN_FLAG_FD_STDOUT ?
> +		STDOUT_FILENO : STDERR_FILENO;
> +
> +	if (!popen_may_io(handle, idx, flags))
> +		return -1;
> +
> +	if (count > (size_t)SSIZE_MAX) {
> +		errno = E2BIG;
> +		return -1;
> +	}
> +
> +	if (timeout < 0.)
> +		timeout = TIMEOUT_INFINITY;
> +
> +	say_debug("popen: %d: read idx [%s:%d] buf %p count %zu "
> +		  "fds %d timeout %.9g",
> +		  handle->pid, stdX_str(idx), idx, buf, count,
> +		  handle->fds[idx], timeout);
> +
> +	return coio_read_fd_timeout(handle->fds[idx],
> +				    buf, count, timeout);
> +}

Right, so could you please use struct coio here, and not
coio_read_fd_timeout? I.e. convert handle->fds to coio?


-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list