-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Make EINVAL handling more robust and revert binary #1076
Conversation
👍 |
@@ -166,11 +166,20 @@ main(int argc, char **argv) | |||
|
|||
#ifdef O_SYNC | |||
fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY | O_DIRECT | O_SYNC); | |||
if(fd < 0 && errno == EINVAL){ // O_SYNC not supported (e.g. raspberian) | |||
// Some system do not support certain parameters (e.g. raspberian) |
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 //
comments instead of /**/
?
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.
system -> systems
@simonduq: Thanks. Seems like today is a dyslexia-day. /me somtimes hates his brain. |
we've all been there ;) |
excellent, 👍 (but let's keep the pull open a bit longer before merging to give others a chance to review it) |
Sound like a good idea. ;) My PRs weren't very good lately. :( |
1e359d2 from #1048 broke compilation on OS X :( Any chance we could look into this as well? Happy to test recommended changes if you don't have access to OS X
|
shouldn't |
@simonduq You're totally right. I should refrain from making PRs while writing my phd. It just makes me feel even more incompetent. ;) |
This compiles now, yes. |
Works for me, thanks for the work put into this! but why did you revert the binary instead of producing a new one? |
I'm still wondering why we need O_DIRECT ? AFAIK, the effect of O_DIRECT is to bypass the kernel cache and use DMA if possible, but the bitrate is so low and anyway we are using O_SYNC to wait for the data to be written. |
@alignan I don't have a 32bit system at hand. I could compile using -m32, but again, testing would be a good idea. |
I wonder whether there are historic reasons why we are shipping binaries here :) |
@g-oikonomou Other make-files depend on them. They would need to call make first. Though adding another target shouldn't be too complicated. Also it it quite convenient to download the binary without the need of compiling it. |
+1 for the removal of the binary. Every once in a while, I forgot to recompile it on ARM platform and wonders why it does not work anymore :) |
The counter-argument would be: ship it as part of instant contiki, perhaps somewhere inside the PATH. Perhaps even provide 3-4 pre-compiled versions somewhere e.g. in the wiki. Remove it from git and document how to build it for git users. This would have prevented the situation you are having to deal with now. |
What about shipping precompiled versions that get copied if there is no gcc available? |
I am not 100% I understand what you had in mind, but I do find it unlikely for people to be using git without having gcc installed in some shape or form. Just to be clear, I am not suggesting that this pull is not acceptable without removing the binary. I was just wondering aloud about why we were shipping it in the first place and whether we want to keep doing so |
@g-oikonomou I was fully aware that we were getting off-topic. ;) But to continue that and get more verbose about my idea:
|
Hi, Another aspect maybe worth keeping in mind here is that one needs to be in general very cautious about storing binaries in Git especially when they tend to change now and then as all versions of all binaries become part of the Git repo. I learned the hard way myself that this way a Git repo can become quickly too large to handle - and that it is major pain in the neck to get rid of those artifacts afterwards. Just my two cents, |
So the more I'm looking at this, the more I'm getting convinced that those (and perhaps other binaries too) need getting rid off.
Probably a good idea. By the way, there is a slightly different serialdump under the stm32 folder. "There can be only one" ultimately.
Still not convinced 100% (nor do I understand 100%). Copy serialdump- from where to where? If you absolutely had to provide serialdump- without building it, then I would be strongly in favour of wgetting it instead of shipping it under version control. And just to keep digressing off topic, the entire tools dir needs a little love. |
@g-oikonomou You convinced me. :) I still didn't manage to get Cooja out of Contiki, though. :) |
I'm OK to merge as it is, then the thread comments can be addressed in a separate PR 👍 |
@alignan @g-oikonomou : I can also rebase without e38bc3b. But currently I do not have the time to fix those make-files to get rid of the binary. |
I'm OK either way, no strong opinion about the binary. |
No need to get rid of the binary within this particular pull |
👍 |
Make EINVAL handling more robust and revert binary
As of #1073 this fixes things.