summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2003-05-10 18:58:17 +0000
committeriedowse <iedowse@FreeBSD.org>2003-05-10 18:58:17 +0000
commit9e09746efa5431d5af0baf849575917d37cfdb76 (patch)
tree06152f27e09a6c6df8157fdba70912040ee3aac4 /sbin/newfs
parent988354fc06d732a75efc2f137144a82888957a80 (diff)
downloadFreeBSD-src-9e09746efa5431d5af0baf849575917d37cfdb76.zip
FreeBSD-src-9e09746efa5431d5af0baf849575917d37cfdb76.tar.gz
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 <l.ertl@univie.ac.at> Reviewed by: jmallett Approved by: re (bmah)
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/mkfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index faadedb..58e736d 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);
}
/*
OpenPOWER on IntegriCloud