aboutsummaryrefslogtreecommitdiff
path: root/internal/prefer_openssl
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-07-04 08:19:26 +0200
committerJakob Unterwurzacher2016-07-04 08:19:26 +0200
commit603e144f5ed7053a8a79238c7e072bc476a7e881 (patch)
tree75708841a84987b43ddadba4f64ccd162d57c6b9 /internal/prefer_openssl
parent52655843ab68a37f0000b009cf90cf370df32f98 (diff)
prefer_openssl: OSX: get rid of /proc warnings
OSX does not have /proc/cpuinfo, but let's not warn the user about it.
Diffstat (limited to 'internal/prefer_openssl')
-rw-r--r--internal/prefer_openssl/prefer.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/prefer_openssl/prefer.go b/internal/prefer_openssl/prefer.go
index 598b26b..81378a8 100644
--- a/internal/prefer_openssl/prefer.go
+++ b/internal/prefer_openssl/prefer.go
@@ -3,6 +3,7 @@ package prefer_openssl
import (
"io/ioutil"
"regexp"
+ "runtime"
"github.com/rfjakob/gocryptfs/internal/tlog"
)
@@ -16,9 +17,12 @@ import (
// filePreferOpenSSL takes an explicit filename so it can be tested with saved
// cpuinfo files instead of /proc/cpuinfo.
func filePreferOpenSSL(file string) bool {
+ if runtime.GOOS == "darwin" && file == "/proc/cpuinfo" {
+ // OSX does not have /proc, let's not warn about it.
+ return true
+ }
ci, err := ioutil.ReadFile(file)
if err != nil {
- tlog.Warn.Println(err)
return true
}
haveAes, err := regexp.Match(`(?m)^flags.*\baes\b`, ci)