Skip to content

Commit

Permalink
ExternalProcess: Fixed Windows compilation by adding a Linux OS guard…
Browse files Browse the repository at this point in the history
… condition.
  • Loading branch information
levy committed Mar 25, 2024
1 parent 3b29c8b commit 6dcb32a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/inet/common/ExternalProcess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ bool ExternalProcess::notify(int fd)

void ExternalProcess::startProcess()
{
#ifdef __linux__
NetworkNamespaceContext context(par("namespace"));
EV_DEBUG << "Starting process: " << command << std::endl;
int stdout_pipe[2];
Expand Down Expand Up @@ -123,6 +124,9 @@ void ExternalProcess::startProcess()
rtScheduler->addCallback(processStdout, this);
rtScheduler->addCallback(processStderr, this);
}
#else
throw cRuntimeError("External processes are only supported on Linux");
#endif
}

void ExternalProcess::stopProcess()
Expand Down

0 comments on commit 6dcb32a

Please sign in to comment.