[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/30] util: use qemu_create() in qemu_write_pidfile()
From: |
marcandre . lureau |
Subject: |
[PULL 26/30] util: use qemu_create() in qemu_write_pidfile() |
Date: |
Thu, 21 Apr 2022 17:49:36 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
util/oslib-posix.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 9751bc6be9d7..bcb35c3c8246 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;
}
--
2.36.0
- [PULL 16/30] include: add qemu/keyval.h, (continued)
- [PULL 16/30] include: add qemu/keyval.h, marcandre . lureau, 2022/04/21
- [PULL 17/30] include: move qdict_{crumple,flatten} declarations, marcandre . lureau, 2022/04/21
- [PULL 19/30] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD}, marcandre . lureau, 2022/04/21
- [PULL 18/30] tests: remove block/qdict checks from check-qobject.c, marcandre . lureau, 2022/04/21
- [PULL 20/30] tests: run-time skip test-qga if TSAN is enabled, marcandre . lureau, 2022/04/21
- [PULL 21/30] Move error_printf_unless_qmp() with monitor unit, marcandre . lureau, 2022/04/21
- [PULL 22/30] qga: move qga_get_host_name(), marcandre . lureau, 2022/04/21
- [PULL 24/30] util: simplify write in signal handler, marcandre . lureau, 2022/04/21
- [PULL 23/30] qtest: simplify socket_send(), marcandre . lureau, 2022/04/21
- [PULL 25/30] util: use qemu_write_full() in qemu_write_pidfile(), marcandre . lureau, 2022/04/21
- [PULL 26/30] util: use qemu_create() in qemu_write_pidfile(),
marcandre . lureau <=
- [PULL 27/30] util: replace qemu_get_local_state_pathname(), marcandre . lureau, 2022/04/21
- [PULL 28/30] qga: remove need for QEMU atomic.h, marcandre . lureau, 2022/04/21
- [PULL 29/30] tests/fuzz: fix warning, marcandre . lureau, 2022/04/21
- [PULL 30/30] qga: use fixed-length and GDateTime for log timestamp, marcandre . lureau, 2022/04/21
- Re: [PULL 00/30] Misc patches, Richard Henderson, 2022/04/21