From 0fc82c6d139b6319664517750cecffb54b64f21c Mon Sep 17 00:00:00 2001 From: Paul Meyer Date: Sat, 13 Jun 2026 10:57:46 +0200 Subject: [PATCH] vmspawn: return negative errno from qemu_config_key()/_section_impl() errno_or_else() already returns a negative errno, so "return -errno_or_else(EIO)" returned a positive value on fprintf()/ferror() failure. Callers checking "r < 0" therefore missed the write error and treated it as success. Drop the spurious negation; these were the only two "-errno_or_else" uses in the tree. Co-developed-by: Claude Opus 4.8 Signed-off-by: Paul Meyer --- src/vmspawn/vmspawn-qemu-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmspawn/vmspawn-qemu-config.c b/src/vmspawn/vmspawn-qemu-config.c index d17e841e35..a58e1f141b 100644 --- a/src/vmspawn/vmspawn-qemu-config.c +++ b/src/vmspawn/vmspawn-qemu-config.c @@ -31,7 +31,7 @@ int qemu_config_key(FILE *f, const char *key, const char *value) { return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "QEMU config value '%s' contains unsafe characters.", value); if (fprintf(f, " %s = \"%s\"\n", key, value) < 0) - return -errno_or_else(EIO); + return errno_or_else(EIO); return 0; } @@ -88,7 +88,7 @@ int qemu_config_section_impl(FILE *f, const char *type, const char *id, ...) { va_end(ap); if (ferror(f)) - return -errno_or_else(EIO); + return errno_or_else(EIO); return 0; }