mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 00:21:30 +00:00
platform: Fix build on windows
This commit is contained in:
parent
72dbf2e2b4
commit
5bf177b021
|
@ -79,7 +79,7 @@ func (w *platformInterfaceWrapper) OpenTun(options tun.Options, platformOptions
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dupFd, err := syscall.Dup(int(tunFd))
|
||||
dupFd, err := dup(int(tunFd))
|
||||
if err != nil {
|
||||
return nil, E.Cause(err, "dup tun file descriptor")
|
||||
}
|
||||
|
|
9
experimental/libbox/service_other.go
Normal file
9
experimental/libbox/service_other.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
//go:build !windows
|
||||
|
||||
package libbox
|
||||
|
||||
import "syscall"
|
||||
|
||||
func dup(fd int) (nfd int, err error) {
|
||||
return syscall.Dup(fd)
|
||||
}
|
7
experimental/libbox/service_windows.go
Normal file
7
experimental/libbox/service_windows.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package libbox
|
||||
|
||||
import "os"
|
||||
|
||||
func dup(fd int) (nfd int, err error) {
|
||||
return 0, os.ErrInvalid
|
||||
}
|
Loading…
Reference in a new issue