diff --git a/src/syscall/exec_unix.go b/src/syscall/exec_unix.go index 206c0ab32b5..c6a6caaa708 100644 --- a/src/syscall/exec_unix.go +++ b/src/syscall/exec_unix.go @@ -107,6 +107,9 @@ func SetNonblock(fd int, nonblocking bool) (err error) { if err != nil { return err } + if (flag&O_NONBLOCK != 0) == nonblocking { + return nil + } if nonblocking { flag |= O_NONBLOCK } else {