Skip to content

Commit

Permalink
Merge pull request #1450 from dfr/freebsd-zfs
Browse files Browse the repository at this point in the history
Use unix.Open instead of os.OpenFile for /dev/zfs
  • Loading branch information
giuseppe committed Dec 13, 2022
2 parents b062e9e + aeed7a1 commit 9587fda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/zfs/zfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ func Init(base string, opt graphdriver.Options) (graphdriver.Driver, error) {
return nil, fmt.Errorf("the 'zfs' command is not available: %w", graphdriver.ErrPrerequisites)
}

file, err := os.OpenFile("/dev/zfs", os.O_RDWR, 0600)
file, err := unix.Open("/dev/zfs", unix.O_RDWR, 0600)
if err != nil {
logger.Debugf("cannot open /dev/zfs: %v", err)
return nil, fmt.Errorf("could not open /dev/zfs: %v: %w", err, graphdriver.ErrPrerequisites)
}
defer file.Close()
defer unix.Close(file)

options, err := parseOptions(opt.DriverOptions)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
STORAGE_BINARY=${STORAGE_BINARY:-$(dirname ${BASH_SOURCE})/../containers-storage}
TESTSDIR=${TESTSDIR:-$(dirname ${BASH_SOURCE})}
STORAGE_DRIVER=${STORAGE_DRIVER:-vfs}
STORAGE_TRANSIENT=${STORAGE_TRANSIENT:-}
STORAGE_TRANSIENT=${STORAGE_TRANSIENT:-0}
STORAGE_OPTION=${STORAGE_OPTION:-}
PATH=$(dirname ${BASH_SOURCE})/..:${PATH}
OS=$(uname -s)
Expand Down

0 comments on commit 9587fda

Please sign in to comment.