Bug 8107 - lib/replace/poll.c needs additional includes
Summary: lib/replace/poll.c needs additional includes
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.6.8
Hardware: IA64 Other
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-24 17:01 UTC by Joachim Schmitz (mail address dead)
Modified: 2020-12-11 08:27 UTC (History)
0 users

See Also:


Attachments
Patch (666 bytes, patch)
2012-09-17 12:29 UTC, Volker Lendecke
no flags Details
all patches in one file to make things more clear ... (1.81 KB, patch)
2012-10-09 08:20 UTC, Björn Jacke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Schmitz (mail address dead) 2011-04-24 17:01:40 UTC
I had to add
#include <sys/time.h> /* for FD_* macros */
and 
#include <sys/ioctl.h> /* for ioctl(), FIONREAD, etc */
to get it to compile on HP NonStop
Comment 1 Björn Jacke 2012-09-16 19:31:12 UTC
Thanks, Jojo, this is fixed in master with 520c9b0b0ae33e6e8fb78034cfff685f5491aab3 now. Karo, please pick this to the release branches also.
Comment 2 Karolin Seeger 2012-09-17 09:57:37 UTC
Metze, can you review this one, please?
If not, please feel free to re-assign.

Thanks!
Comment 3 Joachim Schmitz (mail address dead) 2012-09-17 10:28:12 UTC
There's another bug(let) in poll.c, which I detected recently in git and gnulib. The code in Samba suffers from the same problem:

diff -EBbu ./lib/replace/poll.c.orig ./lib/replace/poll.c
--- ./lib/replace/poll.c.orig   2012-07-30 12:13:16 -0500
+++ ./lib/replace/poll.c        2012-09-17 05:15:39 -0500
@@ -40,7 +40,7 @@
        int rc;
        nfds_t i;

-       if (fds == NULL) {
+       if (fds == NULL && nfds != 0) {
                errno = EFAULT;
                return -1;
        }


This way it got fixed in gnulib (any I hope in git too). It results in poll() to be able to work as a millisecond sleep.
I didn't check whether samba uses it that way anywhere though.
Comment 4 Volker Lendecke 2012-09-17 12:29:09 UTC
Created attachment 7898 [details]
Patch

Looks entirely correct. Metze, if you agree, please push to master and ack here.

Thanks,

Volker
Comment 5 Jeremy Allison 2012-09-17 16:44:39 UTC
Yep, completely correct - pushed to autobuild.
Jeremy.
Comment 6 Joachim Schmitz (mail address dead) 2012-09-17 20:42:17 UTC
(In reply to comment #1)
> Thanks, Jojo, this is fixed in master with
> 520c9b0b0ae33e6e8fb78034cfff685f5491aab3 now. Karo, please pick this to the
> release branches also.

There's a bug in that commit, HAVE_SYS_IOCTL (wrong) vs. HAVE SYS_IOCTL_H (working)
Comment 7 Björn Jacke 2012-09-18 12:08:25 UTC
thanks Joachim for spotting that! A fix for that is in autobuild and soon in master
Comment 8 Jeremy Allison 2012-10-08 23:55:21 UTC
This patch (https://bugzilla.samba.org/attachment.cgi?id=7898) has gone into master and applies cleanly to 4.0.0rc3 and 3.6.next.

Re-assigning to Karolin for inclusion in 3.6.next and 4.0.0rc3.

Jeremy.
Comment 9 Björn Jacke 2012-10-09 08:20:14 UTC
Created attachment 8015 [details]
all patches in one file to make things more clear ...
Comment 10 Karolin Seeger 2012-10-09 08:25:38 UTC
(In reply to comment #9)
> Created attachment 8015 [details]
> all patches in one file to make things more clear ...

Pushed to v3-6-test and autobuild-v4-0-test.
Closing out bug report.

Thanks!