mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-19 16:35:10 +03:00
darwin: Adds Check Empty Writes to TUN
This commit is contained in:
parent
da7e7e0a3e
commit
4112fb9cd7
1 changed files with 5 additions and 0 deletions
|
@ -151,6 +151,11 @@ func (t *tunReadCloser) Read(to []byte) (int, error) {
|
|||
}
|
||||
|
||||
func (t *tunReadCloser) Write(from []byte) (int, error) {
|
||||
|
||||
if len(from) == 0 {
|
||||
return 0, syscall.EIO
|
||||
}
|
||||
|
||||
t.wMu.Lock()
|
||||
defer t.wMu.Unlock()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue