mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 22:45:13 +00:00
Fix build failure on illumos
Previously v2ray can not be built on illumos due to following reasons: 1. missing build tags in transport/internet/sockopt_other.go 2. many definitions in syscall does not exist on illumos This commit addresses these problems by adding missing build tags, and updates those missing syscall deps on illumos to use x/sys/unix.
This commit is contained in:
1 parent
206008081d
commit
2a96605138
4 files changed
+42
-4
No files matched your search
@@ -9,8 +9,9 @@ import (
|
||||
gotls "crypto/tls"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/transport/internet"
|
||||
@@ -104,7 +105,7 @@ func (fl *fileLocker) Acquire() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX); err != nil {
|
||||
if err := unix.Flock(int(f.Fd()), unix.LOCK_EX); err != nil {
|
||||
f.Close()
|
||||
return newError("failed to lock file: ", fl.path).Base(err)
|
||||
}
|
||||
@@ -113,7 +114,7 @@ func (fl *fileLocker) Acquire() error {
|
||||
}
|
||||
|
||||
func (fl *fileLocker) Release() {
|
||||
if err := syscall.Flock(int(fl.file.Fd()), syscall.LOCK_UN); err != nil {
|
||||
if err := unix.Flock(int(fl.file.Fd()), unix.LOCK_UN); err != nil {
|
||||
newError("failed to unlock file: ", fl.path).Base(err).WriteToLog()
|
||||
}
|
||||
if err := fl.file.Close(); err != nil {
|
||||
|
||||
Reference in new issue
Block a user