From 7bdf1805b1fad30ffae8bb7c91e2f120dd8159b9 Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Sat, 10 May 2003 18:58:17 +0000 Subject: [PATCH] Put back the error checking in wtfs() that was lost when newfs was changed to use libufs in revision 1.71. Without this, any write failures in newfs were silently ignored. Note that this will display a meaningless errno string in the case of a short write as opposed to a write error, since bwrite()'s return value does not allow the caller to determine if errno is valid. Reported by: Lukas Ertl Reviewed by: jmallett Approved by: re (bmah) --- sbin/newfs/mkfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index faadedb85a31..58e736db5eaf 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -849,7 +849,8 @@ wtfs(ufs2_daddr_t bno, int size, char *bf) { if (Nflag) return; - bwrite(&disk, bno, bf, size); + if (bwrite(&disk, bno, bf, size) < 0) + err(36, "wtfs: %d bytes at sector %jd", size, (intmax_t)bno); } /*