diff options
author | Dave Voutila <dv@cvs.openbsd.org> | 2022-05-20 22:06:48 +0000 |
---|---|---|
committer | Dave Voutila <dv@cvs.openbsd.org> | 2022-05-20 22:06:48 +0000 |
commit | 795d82ed39bfcfea9a516ad771aa627fcab71b29 (patch) | |
tree | 92861667449edc284f4575bc081b74cb64d920e2 /usr.sbin | |
parent | 3b50f78d84229ed2e30b6ba42fd71639dc077751 (diff) |
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/vmd/vioqcow2.c | 6 |
1 files 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 <ori@eigenstate.org> @@ -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) |