neutrino: convert most parts to use safe_system()

e.g. network setup was leaking demux file descriptors to udhcpc
leading to strange issues later when trying to restart neutrino etc.
This commit is contained in:
Stefan Seyfried
2011-12-04 19:34:34 +01:00
parent 60454a643c
commit 5aa75e5820
7 changed files with 46 additions and 49 deletions

View File

@@ -2,10 +2,11 @@
* $port: configure_network.cpp,v 1.7 2009/11/20 22:44:19 tuxbox-cvs Exp $
*
* (C) 2003 by thegoodguy <thegoodguy@berlios.de>
* (C) 2011 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -14,9 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <cstdio> /* perror... */
@@ -31,6 +30,7 @@
#include <iomanip>
#include <sstream>
#include <fstream>
#include <system/safe_system.h>
CNetworkConfig::CNetworkConfig()
{
@@ -240,7 +240,7 @@ void CNetworkConfig::startNetwork(void)
#ifdef DEBUG
printf("CNetworkConfig::startNetwork: %s\n", cmd.c_str());
#endif
system(cmd.c_str());
safe_system(cmd.c_str());
if (!inet_static) {
init_vars();
@@ -254,7 +254,7 @@ void CNetworkConfig::stopNetwork(void)
#ifdef DEBUG
printf("CNetworkConfig::stopNetwork: %s\n", cmd.c_str());
#endif
system(cmd.c_str());
safe_system(cmd.c_str());
}