From: Paolo Bonzini Date: Thu, 06 Sep 2012 15:15:02 GMT Subject: Re: poll() emulation in git Message-ID: <5048BDF6.2000602@gnu.org> In-Reply-To: <010a01cd8c3e$25609500$7021bf00$@schmitz-digital.de> Il 06/09/2012 16:44, Joachim Schmitz ha scritto: >> > Yes, it's an usleep(autocorrect * 100000) basically (poll takes >> > milliseconds, not micro). > OK, it is _supposed_ to do this usleep(), but is does not, as poll() returns early with EFAULT in this case: > /* EFAULT is not necessary to implement, but let's do it in the > simplest case. */ > if (!pfd) > { > errno = EFAULT; > return -1; > } > > poll() is doing this before calling select(), so won't sleep. > So there's a bug in {gnulib|git}'s poll(), right? > Yes, it should be "if (!pfd && nfd)". Paolo