Ticket #21973: kdeinit-fork.patch

File kdeinit-fork.patch, 1.6 KB (added by sharky@…, 15 years ago)

Prevent kdeinit4 crash

  • kinit/kinit.cpp

    old new  
    489489      init_startup_info( startup_id, name, envc, envs );
    490490#endif
    491491
     492  // Don't run this inside the child process, it crashes on OS/X 10.6
     493  const QByteArray docPath = QFile::encodeName(KGlobalSettings::documentPath());
     494#ifdef Q_WS_MAC
     495  QString bundlepath = s_instance->dirs()->findExe(QFile::decodeName(execpath));
     496  QString argvexe = s_instance->dirs()->findExe(QString::fromLatin1(_name));
     497#endif
     498
    492499  d.errorMsg = 0;
    493500  d.fork = fork();
    494501  switch(d.fork) {
     
    513520     if (cwd && *cwd) {
    514521         (void)chdir(cwd);
    515522     } else {
    516          const QByteArray docPath = QFile::encodeName(KGlobalSettings::documentPath());
    517523         (void)chdir(docPath.constData());
    518524     }
    519525
     
    552558       d.argv = (char **) malloc(sizeof(char *) * (argc+1));
    553559       d.argv[0] = (char *) _name;
    554560#ifdef Q_WS_MAC
    555        QString argvexe = s_instance->dirs()->findExe(QString::fromLatin1(d.argv[0]));
    556561       if (!argvexe.isEmpty()) {
    557562          QByteArray cstr = argvexe.toLocal8Bit();
    558563          kDebug(7016) << "kdeinit4: launch() setting argv: " << cstr.data();
     
    628633
    629634        QByteArray executable = execpath;
    630635#ifdef Q_WS_MAC
    631         QString bundlepath = s_instance->dirs()->findExe(QFile::decodeName(executable));
    632636        if (!bundlepath.isEmpty())
    633637           executable = QFile::encodeName(bundlepath);
    634638#endif