If splice data from normal file into pipe and pipe has no enough
buffer(see fcntl), splice will block. If splice flags w/
SPLICE_F_NONBLOCK, in this situation splice will return EAGAIN.
In this situation, we should return and let the caller handle this(read
splice).
This happen the splice read/write in the same thread and first
splice read from normal file and later splice write to normal file.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
}
if (errno == EINTR)
continue;
+ if (errno == EAGAIN)
+ break;
return -errno;
}
cnt += r;