aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-20 17:26:19 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-21 17:09:09 +0400
commit96eb9b2b47ecd923ff67848c0b1a92a900f95d91 (patch)
tree1e407db71a3ed0d6b5fbaf49cc4b106debd690be /util
parentd0dedf2f4c116293d82d0bda510e4bb4d7dfac26 (diff)
downloadqemu-96eb9b2b47ecd923ff67848c0b1a92a900f95d91.zip
qemu-96eb9b2b47ecd923ff67848c0b1a92a900f95d91.tar.gz
qemu-96eb9b2b47ecd923ff67848c0b1a92a900f95d91.tar.bz2
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>
Diffstat (limited to 'util')
-rw-r--r--util/oslib-posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index fd2bdc9..9751bc6 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -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;
}