Bug 11628 - Parameters mismatch in poll_one_fd() call in ../source3/client/dnsbrowse.c:171:55
Parameters mismatch in poll_one_fd() call in ../source3/client/dnsbrowse.c:17...
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
4.3.1
All All
: P4 major
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-02 03:58 UTC by Timur Bakeyev
Modified: 2015-12-07 13:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur Bakeyev 2015-12-02 03:58:53 UTC
Going through warnings, generated by clang while compiling 4.3.2, noticed this one:

../source3/client/dnsbrowse.c:171:45: warning: incompatible pointer to integer conversion passing 'int *' to parameter of type 'int'; remove & [-Wint-conversion]

                ret = poll_one_fd(mdnsfd, POLLIN|POLLHUP, &revents, 1000);
                                                          ^~~~~~~~

../source3/include/proto.h:627:41: note: passing argument to parameter 'timeout' here

int poll_one_fd(int fd, int events, int timeout, int *revents);

                                         ^
../source3/client/dnsbrowse.c:171:55: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'int *' [-Wint-conversion]

                ret = poll_one_fd(mdnsfd, POLLIN|POLLHUP, &revents, 1000);

                                                                    ^~~~
../source3/include/proto.h:627:55: note: passing argument to parameter 'revents' here

int poll_one_fd(int fd, int events, int timeout, int *revents);

                                                     ^
2 warnings generated.

So, revents and timeout parameters are swapped regarding the prototype.
Comment 1 Volker Lendecke 2015-12-02 07:54:50 UTC
Of course 100% right. The only question is: How did you get this code to build? It seems that we've lost the configure checks for DNSSD in the conversion to waf.
Comment 2 Timur Bakeyev 2015-12-07 02:11:52 UTC
(In reply to Volker Lendecke from comment #1)


Hmm, you are right... It seems that this is a result of using this patch https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=183885, which seems never was submitted to upstream despite the intention... It brought the switch back as well as allowed to use either avahi of dns_sd library for zeroconf.

It would be nice if it could be incorporated now into Samba code. And the switch could be re-enabled.
Comment 3 Volker Lendecke 2015-12-07 06:46:54 UTC
(In reply to Timur Bakeyev from comment #2)

Can you post the patch in a form that is a bit easier to apply? I could certainly dig up the changes from the patch in the FreeBSD bugzilla, but it's manual process.

Thanks, Volker