-
Notifications
You must be signed in to change notification settings - Fork 100
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
change std::system to popen #156
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for the PR. Could you add a test for it?
lib/MetaProcessor/MetaSema.cpp
Outdated
std::string command = trimmed.str() + " 2>&1"; | ||
FILE *shell_result = popen(command.c_str(), "r"); | ||
if (shell_result) | ||
{ |
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.
Could you move the brace to the previous line.
lib/MetaProcessor/MetaSema.cpp
Outdated
{ | ||
char buff[512]; | ||
ret = 0; | ||
while(fgets(buff, sizeof(buff), shell_result)!=NULL){ |
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.
It is more common in cling's codebase to use !
upfront and rely on the implicit bool conversion.
I'd add a space after the brace.
@vgvassilev, could you tell me how to build the test suite ? I use |
lib/MetaProcessor/MetaSema.cpp
Outdated
char buff[512]; | ||
ret = 0; | ||
while(fgets(buff, sizeof(buff), shell_result)!=NULL){ | ||
bool flag = fgets(buff, sizeof(buff), shell_result) == NULL; |
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.
What about while(!fgets(buff, sizeof(buff), shell_result))
?
You should be able to do |
@vgvassilev, do I add the test in the |
This PR changes the method to execute a shell command in order to control the output stream.
This solves the issue #154