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

Rename poll to wait #38

Merged
merged 12 commits into from
Jan 3, 2017
Prev Previous commit
Next Next commit
hide that we use stderr
  • Loading branch information
lbartnik committed Jan 2, 2017
commit d9f5aff6cdd74fb92e005463f031c60118b45feb
5 changes: 4 additions & 1 deletion src/sub-linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ extern char ** environ;

#define TRUE 1

// a way to ignore a return value even when gcc warns about it
template<typename T> inline void ignore_return_value (T _t) {}

namespace subprocess {

Expand Down Expand Up @@ -254,7 +256,8 @@ void process_handle_t::spawn (const char * _command, char *const _arguments[],
perror((string("could not run command ") + _command).c_str());
}
catch (subprocess_exception & e) {
fprintf(stderr, "%s\n", e.what());
// we do not name stderr explicitly because CRAN doesn't like it
ignore_return_value(::write(2, e.what(), strlen(e.what())));
exit_on_failure();
}
}
Expand Down