Skip to content
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

Fix serialdump.c #1048

Merged
merged 6 commits into from
May 15, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve O_SYNC logic
  • Loading branch information
cmorty committed May 11, 2015
commit 1e359d232451f19d668359ff5da79e3db021e99d
5 changes: 4 additions & 1 deletion tools/sky/serialdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ main(int argc, char **argv)
}
fprintf(stderr, "connecting to %s (%s)", device, speedname);

#ifndef __APPLE__
#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)
fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY | O_DIRECT);
}
#else
fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY | O_SYNC );
#endif
Expand Down