svn commit: branches/uClibc_0_9_29/libc/sysdeps/linux/common

vapier at uclibc.org vapier at uclibc.org
Sat Jan 5 17:50:13 UTC 2008


Author: vapier
Date: 2008-01-05 09:50:12 -0800 (Sat, 05 Jan 2008)
New Revision: 20783

Log:
Merge r20318 by jocke from trunk:
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:
   branches/uClibc_0_9_29/libc/sysdeps/linux/common/poll.c


Changeset:
Modified: branches/uClibc_0_9_29/libc/sysdeps/linux/common/poll.c
===================================================================
--- branches/uClibc_0_9_29/libc/sysdeps/linux/common/poll.c	2008-01-05 17:50:04 UTC (rev 20782)
+++ branches/uClibc_0_9_29/libc/sysdeps/linux/common/poll.c	2008-01-05 17:50:12 UTC (rev 20783)
@@ -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