file-posix: Handle EINTR in preallocation=full write

Cc: qemu-stable@nongnu.org
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
master
Fam Zheng 2018-07-27 14:53:14 +08:00 committed by Kevin Wolf
parent 308999e9d4
commit a1c81f4f16
1 changed files with 3 additions and 0 deletions

View File

@ -1646,6 +1646,9 @@ static int handle_aiocb_truncate(RawPosixAIOData *aiocb)
num = MIN(left, 65536);
result = write(fd, buf, num);
if (result < 0) {
if (errno == EINTR) {
continue;
}
result = -errno;
error_setg_errno(errp, -result,
"Could not write zeros for preallocation");