diff options
author | Jakob Borg <jakob@nym.se> | 2014-06-16 09:52:14 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-06-16 10:19:32 +0200 |
commit | 12eda0449a571e501527d6266a8079e6d0a3e20c (patch) | |
tree | 4f10936e6182242a0ab55a361f0ff5310097d63a /cmd | |
parent | 5a98f4e47c4c03a5871fa42ec6578f533181b1ee (diff) |
Build and memSize impl for Solaris
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/syncthing/memsize_solaris.go | 20 | ||||
-rw-r--r-- | cmd/syncthing/memsize_unimpl.go | 2 | ||||
-rw-r--r-- | cmd/syncthing/upgrade_supported.go (renamed from cmd/syncthing/upgrade.go) | 2 | ||||
-rw-r--r-- | cmd/syncthing/upgrade_unsupp.go | 9 |
4 files changed, 32 insertions, 1 deletions
diff --git a/cmd/syncthing/memsize_solaris.go b/cmd/syncthing/memsize_solaris.go new file mode 100644 index 0000000000..360b5e1ad3 --- /dev/null +++ b/cmd/syncthing/memsize_solaris.go @@ -0,0 +1,20 @@ +package main + +import ( + "os/exec" + "strconv" +) + +func memorySize() (uint64, error) { + cmd := exec.Command("prtconf", "-m") + out, err := cmd.CombinedOutput() + if err != nil { + return 0, err + } + + mb, err := strconv.ParseUint(string(out), 10, 64) + if err != nil { + return 0, err + } + return mb * 1024 * 1024, nil +} diff --git a/cmd/syncthing/memsize_unimpl.go b/cmd/syncthing/memsize_unimpl.go index 63c4223dd3..b896f895b2 100644 --- a/cmd/syncthing/memsize_unimpl.go +++ b/cmd/syncthing/memsize_unimpl.go @@ -1,4 +1,4 @@ -// +build freebsd solaris +// +build freebsd package main diff --git a/cmd/syncthing/upgrade.go b/cmd/syncthing/upgrade_supported.go index 2ac2843b57..6b09f85331 100644 --- a/cmd/syncthing/upgrade.go +++ b/cmd/syncthing/upgrade_supported.go @@ -2,6 +2,8 @@ // Use of this source code is governed by an MIT-style license that can be // found in the LICENSE file. +// +build !solaris + package main import ( diff --git a/cmd/syncthing/upgrade_unsupp.go b/cmd/syncthing/upgrade_unsupp.go new file mode 100644 index 0000000000..777c5f1de8 --- /dev/null +++ b/cmd/syncthing/upgrade_unsupp.go @@ -0,0 +1,9 @@ +// +build windows solaris + +package main + +import "errors" + +func upgrade() error { + return errors.New("Upgrade currently unsupported on Windows") +} |