aboutsummaryrefslogtreecommitdiff
path: root/util/oslib-posix.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-20 17:26:20 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-21 17:09:09 +0400
commit1b34d08f0b529ccf80e9da9d0928afa97d5d7807 (patch)
tree14ae7c5817954e8a0c6f9bee276442ef1234ad89 /util/oslib-posix.c
parent96eb9b2b47ecd923ff67848c0b1a92a900f95d91 (diff)
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>
Diffstat (limited to 'util/oslib-posix.c')
-rw-r--r--util/oslib-posix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 9751bc6be9..bcb35c3c82 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -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;
}