Skip to content

Commit

Permalink
Fixed HasZFSCommand exec logic
Browse files Browse the repository at this point in the history
  • Loading branch information
SlyngDK committed Oct 7, 2024
1 parent 6938805 commit 8764040
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zfs/ZfsExecutor.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package zfs

import (
"errors"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -33,9 +32,9 @@ func (z *executorImpl) HasZFSCommand() error {
if stat, err := os.Stat(z.zfsCommandName); err == nil {
// Is executable by others
if stat.Mode()&0001 != 0 {
return errors.New("ZFS command is not executable")
return nil
}
return nil
return fmt.Errorf("ZFS command %s is not executable", z.zfsCommandName)
}
return fmt.Errorf("ZFS command %s not found", z.zfsCommandName)
}
Expand Down

0 comments on commit 8764040

Please sign in to comment.