aboutsummaryrefslogtreecommitdiff
path: root/lib/libufs/type.c
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2002-10-22 19:25:58 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2002-10-22 19:25:58 +0000
commit8b8cd35523c520d960d4cab5ea6d684ed3d7bc74 (patch)
treeedec396707e3cbc26393e92c4ed04f24c28b2624 /lib/libufs/type.c
parent103bcded1d409f83c05d181c5b2bd5d4bee0f413 (diff)
downloadsrc-8b8cd35523c520d960d4cab5ea6d684ed3d7bc74.tar.gz
src-8b8cd35523c520d960d4cab5ea6d684ed3d7bc74.zip
Add the concept of a per-disk error string, and a function which prints it
along with the errno, if one is set.
Notes
Notes: svn path=/head/; revision=105737
Diffstat (limited to 'lib/libufs/type.c')
-rw-r--r--lib/libufs/type.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libufs/type.c b/lib/libufs/type.c
index 0b16c801bbf5..8bc30bd34200 100644
--- a/lib/libufs/type.c
+++ b/lib/libufs/type.c
@@ -99,6 +99,7 @@ ufs_disk_fillout(struct uufsd *disk, const char *name)
fd = open(name, O_RDONLY);
if (fd == -1) {
DEBUG("open");
+ disk->d_error = "failed to open disk for reading";
return -1;
}
@@ -109,6 +110,7 @@ ufs_disk_fillout(struct uufsd *disk, const char *name)
disk->d_inomax = 0;
disk->d_name = name;
disk->d_ufs = 0;
+ disk->d_error = NULL;
if (sbread(disk) == -1) {
DEBUG(NULL);