Skip to content

Commit

Permalink
system -> myth_system on lcddevice, mythshutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Beirdo committed Dec 3, 2010
1 parent a49198b commit 0ec18a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 37 deletions.
32 changes: 3 additions & 29 deletions mythtv/libs/libmythdb/lcddevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,6 @@
#include <fcntl.h>
#include <errno.h>

# ifdef linux
# include <sys/vfs.h>
# include <sys/statvfs.h>
# include <sys/sysinfo.h>
# else
# ifdef __FreeBSD__
# include <sys/param.h>
# include <sys/mount.h>
# endif
# if CONFIG_CYGWIN
# include <sys/statfs.h>
# endif
# ifndef _WIN32
# include <sys/sysctl.h>
# endif
# endif

// Qt headers
#include <QApplication>
#include <QRegExp>
Expand All @@ -45,14 +28,8 @@
#include "mythdirs.h"
#include "mythevent.h"
#include "mythsocket.h"
#include "mythsystem.h"

// Necessary for codec icon support

#ifndef _MSC_VER
extern "C" {
#include <stdint.h>
}
#endif

static QString LOC = "lcddevice: ";

Expand Down Expand Up @@ -161,11 +138,8 @@ bool LCD::connectToHost(const QString &lhostname, unsigned int lport)
}

// check if the 'mythlcdserver' is running
int res = system("ret=`ps cax | grep -c mythlcdserver`; exit $ret");
if (WIFEXITED(res))
res = WEXITSTATUS(res);

if (res == 0)
unsigned int res = myth_system("ps ch -C mythlcdserver -o pid > /dev/null");
if (res == 1)
{
// we need to start the mythlcdserver
VERBOSE(VB_GENERAL, "Starting mythlcdserver");
Expand Down
10 changes: 2 additions & 8 deletions mythtv/programs/mythshutdown/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,8 @@ static int unlockShutdown()
*/
static bool isRunning(const char *program)
{
QString sCommand = QString("ret=`ps cax | grep -c %1`; exit $ret")
.arg(program);
QByteArray aCommand = sCommand.toAscii();
int res = system(aCommand.constData());
if (WIFEXITED(res))
res = WEXITSTATUS(res);

return res;
QString command = QString("ps ch -C %1 -o pid > /dev/null").arg(program);
return !myth_system(command);
}

static QDateTime getDailyWakeupTime(QString sPeriod)
Expand Down

0 comments on commit 0ec18a2

Please sign in to comment.