From 3f48398ea93b1332d683a2498b4065278ff9faec Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 4 Apr 2008 12:33:41 +0000 Subject: [PATCH] - apply upstream patch to fix klauncher crash --- kdelibs-4.0.3-kconfig_sync_crash.patch | 4 +- kdelibs-4.0.3-klauncher-crash.patch | 83 ++++++++++++++++++++++++++ kdelibs.spec | 10 +++- 3 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 kdelibs-4.0.3-klauncher-crash.patch diff --git a/kdelibs-4.0.3-kconfig_sync_crash.patch b/kdelibs-4.0.3-kconfig_sync_crash.patch index 60a0191..51a0ca9 100644 --- a/kdelibs-4.0.3-kconfig_sync_crash.patch +++ b/kdelibs-4.0.3-kconfig_sync_crash.patch @@ -1,5 +1,5 @@ ---- branches/KDE/4.0/kdelibs/kdecore/kernel/kglobal.cpp 2008/01/04 09:09:11 757128 -+++ branches/KDE/4.0/kdelibs/kdecore/kernel/kglobal.cpp 2008/04/04 08:48:53 793504 +--- kdelibs/kdecore/kernel/kglobal.cpp 2008/01/04 09:09:11 757128 ++++ kdelibs/kdecore/kernel/kglobal.cpp 2008/04/04 08:48:53 793504 @@ -28,6 +28,12 @@ #include "kglobal.h" #include "kglobal_p.h" diff --git a/kdelibs-4.0.3-klauncher-crash.patch b/kdelibs-4.0.3-klauncher-crash.patch new file mode 100644 index 0000000..200ead2 --- /dev/null +++ b/kdelibs-4.0.3-klauncher-crash.patch @@ -0,0 +1,83 @@ +Index: kinit/klauncher.cpp +=================================================================== +--- kinit/klauncher.cpp (Revision 792865) ++++ kinit/klauncher.cpp (Revision 792866) +@@ -231,16 +231,19 @@ + { + #ifdef Q_WS_X11 + if( mCached_dpy != NULL ) ++ { + XCloseDisplay( mCached_dpy ); ++ mCached_dpy = NULL; ++ } + #endif + } + + void +-KLauncher::destruct(int exit_code) ++KLauncher::destruct() + { + if (QCoreApplication::instance()) ((KLauncher*)QCoreApplication::instance())->close(); + // We don't delete the app here, that's intentional. +- ::_exit(exit_code); ++ ::_exit(255); + } + + void KLauncher::setLaunchEnv(const QString &name, const QString &value) +@@ -312,7 +315,7 @@ + kDebug(7016) << "Exiting on read_socket errno:" << errno; + ::signal( SIGHUP, SIG_IGN); + ::signal( SIGTERM, SIG_IGN); +- destruct(255); // Exit! ++ destruct(); // Exit! + } + requestData.resize(request_header.arg_length); + result = read_socket(kdeinitSocket, (char *) requestData.data(), +Index: kinit/klauncher_main.cpp +=================================================================== +--- kinit/klauncher_main.cpp (Revision 792865) ++++ kinit/klauncher_main.cpp (Revision 792866) +@@ -35,13 +35,15 @@ + #include + + #ifndef Q_WS_WIN ++static int sigpipe[ 2 ]; + static void sig_handler(int sig_num) + { + // No recursion + signal( SIGHUP, SIG_IGN); + signal( SIGTERM, SIG_IGN); +-fprintf(stderr, "klauncher: Exiting on signal %d\n", sig_num); +- KLauncher::destruct(255); ++ fprintf(stderr, "klauncher: Exiting on signal %d\n", sig_num); ++ char tmp = 'x'; ++ write( sigpipe[ 1 ], &tmp, 1 ); + } + #endif + +@@ -103,6 +105,9 @@ + QDBusConnection::sessionBus().registerObject("/", launcher); + + #ifndef Q_WS_WIN ++ pipe( sigpipe ); ++ QSocketNotifier* signotif = new QSocketNotifier( sigpipe[ 0 ], QSocketNotifier::Read, launcher ); ++ QObject::connect( signotif, SIGNAL( activated( int )), launcher, SLOT( destruct())); + KCrash::setEmergencySaveFunction(sig_handler); + signal( SIGHUP, sig_handler); + signal( SIGPIPE, SIG_IGN); +Index: kinit/klauncher.h +=================================================================== +--- kinit/klauncher.h (Revision 792865) ++++ kinit/klauncher.h (Revision 792866) +@@ -123,8 +123,10 @@ + ~KLauncher(); + + void close(); +- static void destruct(int exit_code); // exit! + ++public slots: ++ void destruct(); // exit! ++ + protected: + void processDied(pid_t pid, long exitStatus); + diff --git a/kdelibs.spec b/kdelibs.spec index 1f863a7..2e85892 100644 --- a/kdelibs.spec +++ b/kdelibs.spec @@ -1,7 +1,7 @@ Summary: K Desktop Environment 4 - Libraries Version: 4.0.3 -Release: 5%{?dist} +Release: 6%{?dist} %if 0%{?fedora} > 8 Name: kdelibs @@ -84,6 +84,7 @@ Patch14: kdelibs-4.0.3-libexecdir.patch # based on SVN commit 793504 by dfaure # Move the umask value out of KConfigPrivate to avoid a crash on exit when ~KConfig calls sync. Patch100: kdelibs-4.0.3-kconfig_sync_crash.patch +Patch101: kdelibs-4.0.3-klauncher-crash.patch BuildRequires: qt4-devel >= 4.3.0 Requires: qt4 >= %{_qt4_version} @@ -204,8 +205,8 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{version}-%{release}|" kio/kio/kprotocolmanage %patch13 -p1 -b .fedora-buildtype %patch14 -p1 -b .libexecdir -%patch100 -p4 -b .kconfig_sync_crash - +%patch100 -p1 -b .kconfig_sync_crash +%patch101 -p1 -b .klauncher-crash %build @@ -365,6 +366,9 @@ rm -rf %{buildroot} %changelog +* Fri Apr 04 2008 Than Ngo - 4.0.3-6 +- apply upstream patch to fix klauncher crash + * Fri Apr 4 2008 Rex Dieter 4.0.3-5 - kconfig_sync_crash patch