Close stdin, stdout and stderr when using --server option
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Mon, 23 Apr 2018 16:49:22 +0000 (19:49 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Fri, 27 Apr 2018 17:49:15 +0000 (20:49 +0300)
src/debug/netcoredbg/platform.cpp

index 1482f1d..78ec636 100644 (file)
@@ -313,6 +313,11 @@ IORedirectServer::IORedirectServer(uint16_t port) : m_in(nullptr), m_out(nullptr
     }
 
     ::listen(m_sockfd, 5);
+
+    close(STDIN_FILENO);
+    close(STDOUT_FILENO);
+    close(STDERR_FILENO);
+
     clilen = sizeof(cli_addr);
     newsockfd = ::accept(m_sockfd, (struct sockaddr *) &cli_addr, &clilen);
     if (newsockfd < 0)