diff options
Diffstat (limited to 'lib/libufs/type.c')
-rw-r--r-- | lib/libufs/type.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/libufs/type.c b/lib/libufs/type.c index 4b8066ce2e3a..41eacfd6a977 100644 --- a/lib/libufs/type.c +++ b/lib/libufs/type.c @@ -111,6 +111,18 @@ ufs_disk_close(struct uufsd *disk) int ufs_disk_fillout(struct uufsd *disk, const char *name) { + if (ufs_disk_fillout_blank(disk, name) == -1) { + return -1; + } + if (sbread(disk) == -1) { + ERROR(disk, "could not read superblock to fill out disk"); + return -1; + } +} + +int +ufs_disk_fillout_blank(struct uufsd *disk, const char *name) +{ struct stat st; struct fstab *fs; const char *oname; @@ -161,10 +173,5 @@ again: if (stat(name, &st) < 0) { } disk->d_name = name; - if (sbread(disk) == -1) { - ERROR(disk, "could not read superblock to fill out disk"); - return -1; - } - return 0; } |