[Tarantool-patches] [PATCH 1/2] Copy DSO module before load instead of symlink-ing

Cyrill Gorcunov gorcunov at gmail.com
Tue May 26 18:16:26 MSK 2020


On Mon, May 25, 2020 at 04:13:54PM +0300, Kirill Yukhin wrote:
> +
> +	off_t pos, left;
> +	for (left = st.st_size, pos = 0; left > 0;) {
> +		off_t ret = eio_sendfile_sync(dest_fd, source_fd, pos,
> +					      st.st_size);
> +		if (ret < 0) {
> +			diag_set(SystemError, "failed to copy DSO %s to %s",
> +				 path, load_name);
> +			close(source_fd);
> +			close(dest_fd);
> +			goto error;
> +		}
> +		pos += ret;
> +		left -= ret;
> +	}
> +	close(source_fd);
> +	close(dest_fd);

Kirill, we don't need the for() cycle here, the eio_sendfile_sync
will handle the cycle by self (inside implementation).


More information about the Tarantool-patches mailing list