util: use qemu_create() in qemu_write_pidfile()
qemu_open_old(O_CREATE) should be replaced with qemu_create() which handles Error reporting. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-38-marcandre.lureau@redhat.com>
This commit is contained in:
parent
96eb9b2b47
commit
1b34d08f0b
@ -138,9 +138,8 @@ bool qemu_write_pidfile(const char *path, Error **errp)
|
||||
.l_len = 0,
|
||||
};
|
||||
|
||||
fd = qemu_open_old(path, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
|
||||
fd = qemu_create(path, O_WRONLY, S_IRUSR | S_IWUSR, errp);
|
||||
if (fd == -1) {
|
||||
error_setg_errno(errp, errno, "Cannot open pid file");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user