diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 9fe9d5e1042..80136abcf76 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -0d979f0b860cfd879754150e0ae5e1018b94d7c4 +81eb6a3f425b2158c67ee32c0cc973a72ce9d6be The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/runtime/netpoll_select.c b/libgo/runtime/netpoll_select.c index b4613359118..033661d17f2 100644 --- a/libgo/runtime/netpoll_select.c +++ b/libgo/runtime/netpoll_select.c @@ -135,6 +135,8 @@ runtime_netpoll(bool block) byte b; struct stat st; + allocatedfds = false; + retry: runtime_lock(&selectlock); @@ -146,11 +148,13 @@ runtime_netpoll(bool block) } if(inuse) { - prfds = runtime_SysAlloc(4 * sizeof fds, &mstats.other_sys); - pwfds = prfds + 1; - pefds = pwfds + 1; - ptfds = pefds + 1; - allocatedfds = true; + if(!allocatedfds) { + prfds = runtime_SysAlloc(4 * sizeof fds, &mstats.other_sys); + pwfds = prfds + 1; + pefds = pwfds + 1; + ptfds = pefds + 1; + allocatedfds = true; + } } else { prfds = &grfds; pwfds = &gwfds; @@ -216,7 +220,7 @@ runtime_netpoll(bool block) mode = 'r' + 'w'; --c; } - if(i == rdwake) { + if(i == rdwake && mode != 0) { while(read(rdwake, &b, sizeof b) > 0) ; continue;