aboutsummaryrefslogtreecommitdiff
path: root/util
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
parent96eb9b2b47ecd923ff67848c0b1a92a900f95d91 (diff)
downloadqemu-1b34d08f0b529ccf80e9da9d0928afa97d5d7807.zip
qemu-1b34d08f0b529ccf80e9da9d0928afa97d5d7807.tar.gz
qemu-1b34d08f0b529ccf80e9da9d0928afa97d5d7807.tar.bz2
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')
-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 9751bc6..bcb35c3 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;
}