util: use qemu_write_full() in qemu_write_pidfile()

Mostly for correctness.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220420132624.2439741-37-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-04-20 17:26:19 +04:00
parent d0dedf2f4c
commit 96eb9b2b47
1 changed files with 1 additions and 1 deletions

View File

@ -184,7 +184,7 @@ bool qemu_write_pidfile(const char *path, Error **errp)
}
snprintf(pidstr, sizeof(pidstr), FMT_pid "\n", getpid());
if (write(fd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
if (qemu_write_full(fd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
error_setg(errp, "Failed to write pid file");
goto fail_unlink;
}