Skip to content

Commit

Permalink
Flush buffer for cam2image too
Browse files Browse the repository at this point in the history
  • Loading branch information
dhood committed Mar 7, 2017
1 parent ff1551a commit 0e42da7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions image_tools/src/cam2image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <cstdio>
#include <iostream>
#include <memory>
#include <string>
Expand Down Expand Up @@ -84,6 +85,11 @@ int main(int argc, char * argv[])
size_t height = 240;
bool burger_mode = false;

// Force flush of the stdout buffer.
// This ensures a correct sync of all prints
// even when executed simultaneously within a launch file.
setvbuf(stdout, NULL, _IONBF, BUFSIZ);

// Configure demo parameters with command line options.
bool success = parse_command_options(
argc, argv, &depth, &reliability_policy, &history_policy, &show_camera, &freq, &width, &height,
Expand Down
1 change: 1 addition & 0 deletions image_tools/src/showimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
Expand Down

0 comments on commit 0e42da7

Please sign in to comment.