38 #include <QCoreApplication> 47 #if CONFIG_CYGWIN || defined(_WIN32) 62 #if CONFIG_CYGWIN || defined(_WIN32) 72 setObjectName(
"MythSystemLegacy()");
81 setObjectName(QString(
"MythSystemLegacy(%1)").arg(command));
102 LOG(VB_GENERAL, LOG_ERR,
103 QString(
"MythSystemLegacy(%1) command not understood")
122 const QStringList &
args,
136 const QStringList &
args,
uint flags)
162 if (!
GetSetting(
"UseShell") && access(command.toUtf8().constData(), X_OK))
164 LOG(VB_GENERAL, LOG_ERR,
165 QString(
"MythSystemLegacy(%1) command not executable, ")
166 .arg(command) +
ENO);
267 qApp->processEvents();
305 int posix_signal = SIGTRAP;
325 if (SIGTRAP == posix_signal)
327 LOG(VB_SYSTEM, LOG_ERR,
328 QString(
"Programmer error: Unknown signal %1").arg(sig));
340 LOG(VB_SYSTEM, LOG_DEBUG, QString(
"status: %1").arg(
m_status));
352 LOG(VB_SYSTEM, LOG_DEBUG,
"Adding background flag");
418 return m_stdbuff[0].write(ba.constData());
483 if (out.contains(
"\""))
484 out = out.replace(
"\"",
"\\\"");
486 if (out.contains(
"\'"))
487 out = out.replace(
"\'",
"\\\'");
489 if (out.contains(
" "))
518 QString cmd(command);
unsigned int myth_system_c(char *command, uint flags, uint timeout)
virtual void Term(bool force=false)=0
void Run(time_t timeout=0)
Runs a command inside the /bin/sh shell. Returns immediately.
avoid disabling UI drawing
automatically delete if backgrounded
static QString ShellEscape(const QString &str)
virtual void Manage(void)=0
General purpose reference counter.
MythSystemLegacyPrivate * d
run child in the background
QByteArray Read(int size)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void SetCommand(const QString &, uint)
Resets an existing MythSystemLegacy object to a new command.
MythSystemLegacyPrivate(const QString &debugName)
static Type kPushDisableDrawingEventType
void initializePrivate(void)
process events while waiting
static Type kPopDisableDrawingEventType
add arguments for MythTV log propagation
void ProcessFlags(uint flags)
void Term(bool force=false)
allow exit values 0-127 only
virtual bool ParseShell(const QString &cmd, QString &abscmd, QStringList &args)=0
static Type kLockInputDevicesEventType
run process through shell
#define GENERIC_EXIT_CMD_NOT_FOUND
Command not found.
bool logPropagateQuiet(void)
Check if we are propagating a "--quiet".
void SetDirectory(const QString &)
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
#define GENERIC_EXIT_NO_HANDLER
No MythSystemLegacy Handler.
#define GENERIC_EXIT_RUNNING
Process is running.
uint myth_system(const QString &command, uint flags, uint timeout)
#define ENO
This can be appended to the LOG args with "+".
disable MythMessage UDP listener for the duration of application.
virtual void Fork(time_t timeout)=0
uint Wait(time_t timeout=0)
#define GENERIC_EXIT_START
MythSystemLegacy process starting.
static Type kEnableUDPListenerEventType
static Type kDisableUDPListenerEventType
#define LOG(_MASK_, _LEVEL_, _STRING_)
QByteArray ReadErr(int size)
int Write(const QByteArray &)
This writes to the standard input of the program being run.
virtual void Signal(int sig)=0
QByteArray & ReadAllErr()
MythSystemLegacy(QObject *=nullptr)
bool GetSetting(const char *setting)
#define GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
QObject * GetGUIObject(void)
static Type kUnlockInputDevicesEventType
QStringList logPropagateArgList
avoid blocking LIRC & Joystick Menu