mirror of
https://github.com/fumiama/water.git
synced 2026-06-30 00:40:26 +08:00
darwin: Adds Check Empty Writes to TUN
This commit is contained in:
@@ -151,6 +151,11 @@ func (t *tunReadCloser) Read(to []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *tunReadCloser) Write(from []byte) (int, error) {
|
func (t *tunReadCloser) Write(from []byte) (int, error) {
|
||||||
|
|
||||||
|
if len(from) == 0 {
|
||||||
|
return 0, syscall.EIO
|
||||||
|
}
|
||||||
|
|
||||||
t.wMu.Lock()
|
t.wMu.Lock()
|
||||||
defer t.wMu.Unlock()
|
defer t.wMu.Unlock()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user