-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace readdir_r #1641
Replace readdir_r #1641
Conversation
Oh, forgot: Fixes #1055 |
Forgot another thing: I also wanted to revert #1168. That might lead to more warning being shown, so not tested yet. Will do so later. So please don't merge yet. |
Okay, Travis tests are failing due to out-of-tree builds. I'll check how other tests are handling test data |
Okay, I'd say this is ready for review & comments. New unit test is passing on Travis, existing tests are flaky and currently sometimes fail non macOS. Doesn't seem to be related to these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments
@peternewman : All comments addressed (code changed or reasoning added ;)). Ready for a new round of review |
Oh, right, linting pointed out some stuff I saw just now. Will also take care of that |
…-aware (PATH_SEPARATOR)
9a4ffc7
to
e6e6d6a
Compare
All lint fixes done and rebased onto latest 0.10 branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments and improvements if you wouldn't mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more comments
Apologies for the flurry of commits @kripton but I've now got Codespell working again on Travis which would need to be sorted to merge this anyway, hope you don't mind. |
No need to excuse for the Travis-fixing commits.
As far as I understand: If opendir fails, it'll return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that a successful opendir WITH an value in errno would mean. But ASSERTING it to be 0 when the manuals says it could be changed seems a bit risky to me.
Ah yeah true. I see your point.
If we can have a comment briefly explaining why it's being set to 0 (due to the NULL thing), and then one other style comment and we're good to go thanks.
Feel free to take some credit for this and other bits you've done in AUTHORS if you'd like, and add a line to NEWS (or I can do the latter).
Hi @peternewman , I've added comments regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry a handful of minor style bits I'd somehow missed before.
Thanks for fixing Codespell too!
One thing I noticed: Travis build on macOS fails due to newer libmicrohttpd. I'm experiencing the same on my Gentoo Linux machine. v0.9.70 is fine, v0.9.71 fails. |
Oops, that's embarrassing, I'd just assumed it was the tests that are always flaky on Mac and hadn't looked yet. Looks like it's someone else who doesn't understand semver! See for example https://bugs.archlinux.org/task/67208 which links to https://git.gnunet.org/libmicrohttpd.git/commit/?id=6347f514aa2388e774d5bf356df8046864e5f73c and their fix seems to be here: systemd/systemd@d17eabb#diff-2d7e61049e387b011a9df20244a7922d Do you want to chuck all the necessary #ifdef cotton wool in, either in this PR or another one? We'd normally deal with it like this: ola/libs/usb/LibUsbAdaptor.cpp Lines 175 to 183 in a4f2c0c
See also: xbmc/xbmc#18131 and https://git.gnunet.org/gnunet.git/tree/src/include/gnunet_mhd_compat.h |
Yep, that libmicrohttpd-changes are a pity. I'll create a separate PR for that, feel free to create an issue to track the build breakage. |
@peternewman I think I've done all changes + pushed now :) Let's see what Travis says, despite the expected-for-now failures on macOS |
#1650 created to track the libmicrohttpd build failures. However, now Travis fails on macOS due to some python file conflicts..... |
From what I can see, it's trying to upgrade the Homebrew packages, so postgis pulls in numpy via Homebrew but because numpy is already installed via pip it fails. Hopefully Travis will get their act together soon, or I can force merge it, or manually delete files/uninstall from pip or something... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this one too!
This PR replaces the deprecated readdir_r with the non-deprecated readdir.
A unit test is added to make sure we don't break anything. Tested on the old readdir_r and the new code.
Open for discussions :)