svn commit: trunk/uClibc/libc/sysdeps/linux/common

jocke at uclibc.org jocke at uclibc.org
Tue Oct 23 11:47:01 UTC 2007


Author: jocke
Date: 2007-10-23 04:47:01 -0700 (Tue, 23 Oct 2007)
New Revision: 20318

Log:
Poll with zero timeout

Jean-Christian de Rivaz writes:
The attached patch solve an issue I faced while using the libdbus-glib
waiting for a D-Bus message or the end of a glib timer at the same time.
This specific case of use generate a poll call with a zero timeout. On
platformes with the glibc a zero timeout poll return immetiately even if
there is no file descriptor event. But on platformes with uClibc a zero
timeout poll block until a file descriptor event occurs.


Modified:
   trunk/uClibc/libc/sysdeps/linux/common/poll.c


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/common/poll.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/poll.c	2007-10-23 09:49:56 UTC (rev 20317)
+++ trunk/uClibc/libc/sysdeps/linux/common/poll.c	2007-10-23 11:47:01 UTC (rev 20318)
@@ -38,6 +38,10 @@
 		tval.tv_sec = timeout / 1000;
 		tval.tv_nsec = (timeout % 1000) * 1000000;
 		ts = &tval;
+	} else if (timeout == 0) {
+		tval.tv_sec = 0;
+		tval.tv_nsec = 0;
+		ts = &tval;
 	}
 	return ppoll(fds, nfds, ts, NULL);
 }




More information about the uClibc-cvs mailing list