diff options
Diffstat (limited to 'cmd/btrfs-fsck/main.go')
-rw-r--r-- | cmd/btrfs-fsck/main.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cmd/btrfs-fsck/main.go b/cmd/btrfs-fsck/main.go index c4bfc75..0083bd9 100644 --- a/cmd/btrfs-fsck/main.go +++ b/cmd/btrfs-fsck/main.go @@ -28,12 +28,10 @@ func Main(imgfilename string) (err error) { defer func() { maybeSetErr(fh.Close()) }() - fs := &btrfs.FS{ - Devices: []*btrfs.Device{ - { - File: fh, - }, - }, + + fs := new(btrfs.FS) + if err := fs.AddDevice(&btrfs.Device{File: fh}); err != nil { + return err } superblock, err := pass0(fs) |