summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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