diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-01 00:00:19 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-01 00:00:19 -0600 |
commit | aee0fa4cf09ef5af90e28441d673ce440e4c2c16 (patch) | |
tree | 5a87486e5bd4f0af400d633d3040edd5ed03bf5c /cmd/btrfs-dump-tree | |
parent | df3e7ef9c5fd0ceb2e89d5afd4e981652f9a8bdd (diff) |
add open/close utility functions
Diffstat (limited to 'cmd/btrfs-dump-tree')
-rw-r--r-- | cmd/btrfs-dump-tree/main.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cmd/btrfs-dump-tree/main.go b/cmd/btrfs-dump-tree/main.go index ded7a39..b226af3 100644 --- a/cmd/btrfs-dump-tree/main.go +++ b/cmd/btrfs-dump-tree/main.go @@ -25,19 +25,14 @@ func Main(imgfilename string) (err error) { } } - fh, err := os.Open(imgfilename) + fs, err := btrfsmisc.Open(os.O_RDONLY, imgfilename) if err != nil { return err } defer func() { - maybeSetErr(fh.Close()) + maybeSetErr(fs.Close()) }() - fs := new(btrfs.FS) - if err := fs.AddDevice(&btrfs.Device{File: fh}); err != nil { - fmt.Printf("(error) %v\n", err) - } - superblock, err := fs.Superblock() if err != nil { return err |