aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-01-31 12:01:24 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-01-31 12:01:24 +0100
commit4d3c71e9ae772d020220596636bc6e3ea07741e5 (patch)
tree0b0122854484c0f5dcee68742d275396c6bed40f /utils
parent7b61129b2ed89d2cc3ca5560f55c26c6c347a215 (diff)
[HICN-20] Windows compatibility for ping_client, ping_server and hiperf
Change-Id: I15df978e9e4320f7e6b7c5b3f7db025dcfd6aa06 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/src/hiperf.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc
index 65ee315f5..629de54de 100644
--- a/utils/src/hiperf.cc
+++ b/utils/src/hiperf.cc
@@ -711,13 +711,10 @@ int main(int argc, char *argv[]) {
close(fd);
#else
int fd = _open(log_file, _O_WRONLY | _O_APPEND | _O_CREAT, _S_IWRITE | _S_IREAD);
- _dup2(fd, STDOUT_FILENO);
- _dup2(STDOUT_FILENO, STDERR_FILENO);
+ _dup2(fd, _fileno(stdout));
+ _dup2(_fileno(stdout), _fileno(strerr));
_close(fd);
#endif
- dup2(fd, STDOUT_FILENO);
- dup2(STDOUT_FILENO, STDERR_FILENO);
- close(fd);
}
#ifndef _WIN32