Skip to content

Commit

Permalink
better stdin availability checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosho Owa committed Nov 15, 2016
1 parent a43d3d1 commit 890a167
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool Options::IsStdinAvailable() {
fds.fd = 0; // stdin
fds.events = POLLIN;

if (poll(&fds, 1, 0)){
if (poll(&fds, 1, poll_timeout)){
return true;
}
return false;
Expand Down
2 changes: 2 additions & 0 deletions Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Options {
string request_body_;
string request_url_;
bool verbose_ = false;
// timeout msec to check if stdin is available
u_int poll_timeout = 100;

int Parse(int argc, char **argv);

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Options:

## Downloads

- [esperf-0.2.4-linux-x86_64.zip](https://github.com/kosho/esperf/releases/download/0.2.4/esperf-0.2.4-linux-x86_64.zip)
- [esperf-0.2.4-darwin-x86_64.zip](https://github.com/kosho/esperf/releases/download/0.2.4/esperf-0.2.4-darwin-x86_64.zip)
- [esperf-0.2.5-linux-x86_64.zip](https://github.com/kosho/esperf/releases/download/0.2.5/esperf-0.2.5-linux-x86_64.zip)
- [esperf-0.2.5-darwin-x86_64.zip](https://github.com/kosho/esperf/releases/download/0.2.5/esperf-0.2.5-darwin-x86_64.zip)

## Command line usage examples

Expand Down

0 comments on commit 890a167

Please sign in to comment.