mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-28 11:25:20 +01:00
ee2336a24b
Addition by @problame: move getPipeCapacityHint() into platform-specific code. This has the added benefit of not recognizing the envvar as an envconst on platform that do not support resizing pipes. => won't show up in (zrepl status --raw).Global.Envconst fixes #424 cloes #449
23 lines
396 B
Go
23 lines
396 B
Go
// +build !linux
|
|
|
|
package zfs
|
|
|
|
import (
|
|
"os"
|
|
"sync"
|
|
)
|
|
|
|
func getPipeCapacityHint(envvar string) int {
|
|
return 0 // not supported
|
|
}
|
|
|
|
var zfsPipeCapacityNotSupported sync.Once
|
|
|
|
func trySetPipeCapacity(p *os.File, capacity int) {
|
|
if debugEnabled && capacity != 0 {
|
|
zfsPipeCapacityNotSupported.Do(func() {
|
|
debug("trySetPipeCapacity error: OS does not support setting pipe capacity")
|
|
})
|
|
}
|
|
}
|