Ticket #9714: remove_qstring_from_forked_child.diff

File remove_qstring_from_forked_child.diff, 1.1 KB (added by naf@…, 13 years ago)
  • mythtv/libs/libmythbase/system-unix.cpp

    diff --git a/mythtv/libs/libmythbase/system-unix.cpp b/mythtv/libs/libmythbase/system-unix.cpp
    index d96f405..9f2ec5a 100644
    a b void MythSystemUnix::Fork(time_t timeout) 
    629629    if (GetSetting("SetDirectory") && !dir.isEmpty())
    630630        directory = strdup(dir.toUtf8().constData());
    631631
     632    // check before fork to avoid QString use in child
     633    bool setpgidsetting = GetSetting("SetPGID");
     634
    632635    /* Do this before forking in case the child miserably fails */
    633636    m_timeout = timeout;
    634637    if( timeout )
    void MythSystemUnix::Fork(time_t timeout) 
    763766        /* Set the process group id to be the same as the pid of this child
    764767         * process.  This ensures that any subprocesses launched by this
    765768         * process can be killed along with the process itself. */
    766         if (GetSetting("SetPGID") && setpgid(0,0) < 0 )
     769        if (setpgidsetting && setpgid(0,0) < 0 )
    767770        {
    768771            cerr << locerr
    769772                 << "setpgid() failed: "