From 4a1c7b02a31bb515b74793302bd5b8da691fbb36 Mon Sep 17 00:00:00 2001 From: dv Date: Fri, 20 May 2022 22:06:47 +0000 Subject: [PATCH] use correct logging or error calls ftruncate sets errno, so use fatal() and not fatalx(). Checking for under-reads of read(2) isn't going to set errno so use errx(). ok abieber@ --- usr.sbin/vmd/vioqcow2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/vmd/vioqcow2.c b/usr.sbin/vmd/vioqcow2.c index 08c6b027f07..38805432f81 100644 --- a/usr.sbin/vmd/vioqcow2.c +++ b/usr.sbin/vmd/vioqcow2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vioqcow2.c,v 1.19 2022/05/13 16:46:34 dv Exp $ */ +/* $OpenBSD: vioqcow2.c,v 1.20 2022/05/20 22:06:47 dv Exp $ */ /* * Copyright (c) 2018 Ori Bernstein @@ -533,7 +533,7 @@ mkcluster(struct qcdisk *disk, struct qcdisk *base, off_t off, off_t src_phys) /* Grow the disk */ if (ftruncate(disk->fd, disk->end + disk->clustersz) < 0) - fatalx("%s: could not grow disk", __func__); + fatal("%s: could not grow disk", __func__); if (src_phys > 0) copy_cluster(disk, base, disk->end, src_phys); cluster = disk->end; @@ -640,7 +640,7 @@ virtio_qcow2_create(const char *imgfile_path, if (base_path) { fd = open(base_path, O_RDONLY); if (read(fd, &basehdr, sizeof(basehdr)) != sizeof(basehdr)) - err(1, "failure to read base image header"); + errx(1, "failure to read base image header"); close(fd); if (strncmp(basehdr.magic, VM_MAGIC_QCOW, strlen(VM_MAGIC_QCOW)) != 0) -- 2.20.1