Re: [patch] libdebian-installer poll()
On 09/07/2009, Colin Watson <cjwatson@debian.org> wrote:
> On Tue, Jul 07, 2009 at 01:05:41AM +0200, Luca Favatella wrote:
[...]
>> +// References: http://www.greenend.org.uk/rjk/2001/06/poll.html
>
> While // is a valid comment syntax in C99, it wasn't in earlier versions
> of C, and I believe that /* ... */ is still preferred in libd-i.
Fixed in the attached version 2 of the patch.
Thanks,
Luca Favatella
Index: debian/changelog
===================================================================
--- debian/changelog (.../trunk/packages/libdebian-installer) (revision 59247)
+++ debian/changelog (.../branches/d-i/kfreebsd/packages/libdebian-installer) (revision 59254)
@@ -2,6 +2,10 @@
* Remove a duplicated line from debian/copyright.
+ [ Luca Favatella ]
+ * The poll() system call has EOF-related portability issues. Solve them on
+ kfreebsd-i386. Thanks to Colin Watson for the "poll() and EOF" URL.
+
-- Colin Watson <cjwatson@debian.org> Thu, 18 Jun 2009 12:40:52 +0100
libdebian-installer (0.63) unstable; urgency=low
Index: src/exec.c
===================================================================
--- src/exec.c (.../trunk/packages/libdebian-installer) (revision 59247)
+++ src/exec.c (.../branches/d-i/kfreebsd/packages/libdebian-installer) (revision 59254)
@@ -164,7 +164,12 @@
for (i = 0; i < pipes; i++)
{
+/* References: http://www.greenend.org.uk/rjk/2001/06/poll.html */
+#if defined(__FreeBSD_kernel__)
+ if ((pollfds[i].revents & POLLIN) && (! (pollfds[i].revents & POLLHUP)))
+#else
if (pollfds[i].revents & POLLIN)
+#endif
{
while (fgets (line, sizeof (line), files[i].file) != NULL)
{
Reply to: