mirror of https://github.com/xemu-project/xemu.git
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:
parent
d0dedf2f4c
commit
96eb9b2b47
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue