-
Notifications
You must be signed in to change notification settings - Fork 45
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
Enable CLOEXEC if possible #433
Conversation
Note to self: need to disable this on Kindle legacy, because it's glibc 2.6+. So I need a visible preprocessor constant defined there. |
We don't use most of the things you updated (mostly debug stuff). |
Yep, but I figured why not do everything while I'm there ;). |
Because you are not testing each of them :) |
Okay, ready for real :]. |
There's no magic involved anywhere: if it builds, it works. If it works in one place, it works everywhere. |
Still feels awkward going at updating some old, obsolete, or commented out code that may not even compile if decommented :) and leave traces in git history that it's been updated in 2021 and so probably was tested and worked in 2021. |
There's really zero chance for surprises. Agreed about the header, but unfortunately we don't have a global "internal" header that's included everywhere. Might be time for one, I'll see what I can do |
Do a real glibc version check, and add indentation for clarity.
Hmm, header situation isn't great. I can see a couple of choices, but I'll start by saying that the current approach seems like the best one.
|
There is already a crengine.h, that includes everything. But I guess it's for external frontends use. |
I'm fine with it there, after all, it's right below the path separator define, which is also platform and I/O related, so, there's a precedent ;). |
(Even if I promise to replace 10% of my future |
The idea is that it needs to be accessible everywhere (back/front), so It's also completely inert until code actually explicitly asks for |
What do you mean ? base & front ? Except cre.cpp, nothing should use things from crengine.
Except for polluting lvtypes.h. But if I can't convince you, go ahead. I find this quite ugly, but well, at least I don't have to keep that promise :) |
The fact that it concerns mainly I/O is secondary: it's highly generic platform-specific stuff, which is exactly what lvtypes deals with ;). |
I simply meant anything that uses CRe. i.e., CRe itself (emphasis on the "e", i.e., the engine itself), and CRe frontends (in our case, yeah, that's cre.cpp). |
Mhhhh, either you're not reading me (so, even if I want to give up, I feel like I should insist repeating stuff so you can make an educated decision :), or you have other ideas/plans for the future related to this you're not telling (which I've seen before :)
Uh! The fact that it concerns mainly I/O is primary, that's what it deals with.
Well, no. CLOEXEC stuff does not need to be accessible everywhere. CRe and cre.cpp do not need it: they should use lvstream, which hides the implementation and any platform specific stuff. |
I indeed feel like we're talking about vastly different things, for some reason I can't really comprehend. It's low-level platform specific stuff. It should be visible everywhere (compare it to system-level includes, because that's what it is: an extension of I mean, I can move it to a new |
Mhhh, that's a bit excessive caring :)
That makes sense.
That doesn't. |
Most of those were inheriting it via lvstring.h (directly or indirectly).
Okay, then, completely unnecessary revamp of headers inclusion incoming ;). |
\brief CREngine platform-specific logic | ||
|
||
(c) Vadim Lopatin, 2000-2006 |
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.
Why not credit yourself ? :)
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.
Meh, everything's out of date anyway, and it essentially boils down to
#define PATH_SEPARATOR_CHAR '/'
#define STDIO_CLOEXEC "e"
in 99% of our builds.
So, nothing really all that tangible ^^.
Thanks, that looks more like how it should be :) including the lvstring/lvtypes fixup. How did you find out what needed which header? Just compilations, and fixing errors as they were spitted out ? |
With the help of my best friend ripgrep ;). (i.e., anything that uses |
Good to go @poire-z? |
Yes, go ahead. |
Noticed lingering fds in the WiFi scripts for the book & CRe cache ;).
Windows support untested, obviously, but I tried to handle it sanely ;o).
This change is