summaryrefslogtreecommitdiffstats
path: root/utils/src
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-07-05 17:21:44 +0200
committerMauro Sardara <msardara@cisco.com>2019-07-05 17:23:10 +0200
commit87cd4b4d22a08f1b56cd067770a29bcb05ebb845 (patch)
treeb4b3e31e719266fce94d55081067fafe9b44881a /utils/src
parentd5bfd160f055834fc817422dba152b3714062892 (diff)
[HICN-240] Open stdin fd only in interacrive mode.
Change-Id: I5978776bde6b013a0a9829d62d3d77d6ab1675ad Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'utils/src')
-rw-r--r--utils/src/hiperf.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc
index 66cd559cb..3f9cffd0c 100644
--- a/utils/src/hiperf.cc
+++ b/utils/src/hiperf.cc
@@ -565,13 +565,18 @@ class HIperfServer {
content_objects_index_(0),
mask_((std::uint16_t)(1 << log2_content_object_buffer_size) - 1),
#ifndef _WIN32
- input_(io_service_, ::dup(STDIN_FILENO)),
+ input_(io_service_),
rtc_running_(false)
#endif
{
std::string buffer(configuration_.payload_size_, 'X');
std::cout << "Producing contents under name " << conf.name.getName()
<< std::endl;
+#ifndef _WIN32
+ if (configuration_.interactive_) {
+ input_.assign(::dup(STDIN_FILENO));
+ }
+#endif
for (int i = 0; i < (1 << log2_content_object_buffer_size); i++) {
content_objects_[i] = std::make_shared<ContentObject>(