Skip to content

Commit

Permalink
TWEAK: use Errno != 0 to check for error.
Browse files Browse the repository at this point in the history
tyler-smith committed Dec 19, 2018

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tyler-smith Tyler Smith
1 parent 8c86145 commit 2bb152f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/ffldb/disk_windows.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ func getAvailableDiskSpace(path string) (uint64, error) {
var freeBytes, totalBytes, availBytes int64
_, _, err := c.Call(uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(path))),
uintptr(unsafe.Pointer(&freeBytes)), uintptr(unsafe.Pointer(&totalBytes)), uintptr(unsafe.Pointer(&availBytes)))
if err != nil && err.Error() != "The operation completed successfully." {
if err != nil && err.(syscall.Errno) != 0 {
return 0, err
}

0 comments on commit 2bb152f

Please sign in to comment.