change std::system to popen#156
change std::system to popen#156gouarin wants to merge 3 commits intovgvassilev:masterfrom gouarin:change-shell-command
Conversation
vgvassilev
left a comment
There was a problem hiding this comment.
Thanks for the PR. Could you add a test for it?
| 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.
Could you move the brace to the previous line.
| { | ||
| char buff[512]; | ||
| ret = 0; | ||
| while(fgets(buff, sizeof(buff), shell_result)!=NULL){ |
There was a problem hiding this comment.
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 |
| 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.
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