improve error messages.

This commit is contained in:
christos 2020-03-25 20:17:48 +00:00
parent 78a90419bf
commit bc2a90737a
1 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mkfs.c,v 1.37 2017/02/09 04:42:53 kre Exp $ */ /* $NetBSD: mkfs.c,v 1.38 2020/03/25 20:17:48 christos Exp $ */
/* /*
* Copyright (c) 2002 Networks Associates Technology, Inc. * Copyright (c) 2002 Networks Associates Technology, Inc.
@ -48,7 +48,7 @@
static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95"; static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#else #else
#ifdef __RCSID #ifdef __RCSID
__RCSID("$NetBSD: mkfs.c,v 1.37 2017/02/09 04:42:53 kre Exp $"); __RCSID("$NetBSD: mkfs.c,v 1.38 2020/03/25 20:17:48 christos Exp $");
#endif #endif
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -821,15 +821,15 @@ ffs_wtfs(daddr_t bno, int size, void *bf, const fsinfo_t *fsopts)
offset = bno * fsopts->sectorsize + fsopts->offset; offset = bno * fsopts->sectorsize + fsopts->offset;
if (lseek(fsopts->fd, offset, SEEK_SET) == -1) if (lseek(fsopts->fd, offset, SEEK_SET) == -1)
err(EXIT_FAILURE, "%s: seek error for sector %lld", __func__, err(EXIT_FAILURE, "%s: seek error @%td for sector %jd",
(long long)bno); __func__, offset, (intmax_t)bno);
n = write(fsopts->fd, bf, size); n = write(fsopts->fd, bf, size);
if (n == -1) if (n == -1)
err(EXIT_FAILURE, "%s: write error for sector %lld", __func__, err(EXIT_FAILURE, "%s: write error for sector %jd", __func__,
(long long)bno); (intmax_t)bno);
else if (n != size) else if (n != size)
errx(EXIT_FAILURE, "%s: short write error for sector %lld", errx(EXIT_FAILURE, "%s: short write error for sector %jd",
__func__, (long long)bno); __func__, (intmax_t)bno);
} }