diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-08-07 08:41:57 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-08-07 08:41:57 -0700 |
commit | 37341048a9359cbaccf15ff3716b2e1ae55f4916 (patch) | |
tree | 0fcb7e55206c12796d5e047848f2592c906bc8a3 /osnet | |
parent | b3491f9de18a4d3c029f4f9400b92337091d2274 (diff) | |
download | infinitytier-37341048a9359cbaccf15ff3716b2e1ae55f4916.tar.gz infinitytier-37341048a9359cbaccf15ff3716b2e1ae55f4916.zip |
Silence kextload/kextunload output, error handling improvements.
Diffstat (limited to 'osnet')
-rw-r--r-- | osnet/OSXEthernetTapFactory.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/osnet/OSXEthernetTapFactory.cpp b/osnet/OSXEthernetTapFactory.cpp index b4e0a5d0..a982a422 100644 --- a/osnet/OSXEthernetTapFactory.cpp +++ b/osnet/OSXEthernetTapFactory.cpp @@ -34,6 +34,8 @@ #include "OSXEthernetTapFactory.hpp" #include "OSXEthernetTap.hpp" +#include "../node/Utils.hpp" + namespace ZeroTier { OSXEthernetTapFactory::OSXEthernetTapFactory(const char *pathToTapKext,const char *tapKextName) : @@ -47,6 +49,7 @@ OSXEthernetTapFactory::OSXEthernetTapFactory(const char *pathToTapKext,const cha long kextpid = (long)vfork(); if (kextpid == 0) { ::chdir(_pathToTapKext.c_str()); + Utils::redirectUnixOutputs("/dev/null",(const char *)0); ::execl("/sbin/kextload","/sbin/kextload","-q","-repository",_pathToTapKext.c_str(),_tapKextName.c_str(),(const char *)0); ::_exit(-1); } else if (kextpid > 0) { @@ -76,6 +79,7 @@ OSXEthernetTapFactory::~OSXEthernetTapFactory() sprintf(tmp,"%s/%s",_pathToTapKext.c_str(),_tapKextName.c_str()); long kextpid = (long)vfork(); if (kextpid == 0) { + Utils::redirectUnixOutputs("/dev/null",(const char *)0); ::execl("/sbin/kextunload","/sbin/kextunload",tmp,(const char *)0); ::_exit(-1); } else if (kextpid > 0) { |