mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user