From 44f46e09dc7a3d652ddadec346df03697855aeeb Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 4 Apr 2008 12:13:52 +0000 Subject: [PATCH] * Fri Apr 4 2008 Rex Dieter 4.0.3-5 - kconfig_sync_crash patch --- kdelibs-4.0.3-kconfig_sync_crash.patch | 55 ++++++++++++++++++++++++++ kdelibs.spec | 12 +++++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 kdelibs-4.0.3-kconfig_sync_crash.patch diff --git a/kdelibs-4.0.3-kconfig_sync_crash.patch b/kdelibs-4.0.3-kconfig_sync_crash.patch new file mode 100644 index 0000000..60a0191 --- /dev/null +++ b/kdelibs-4.0.3-kconfig_sync_crash.patch @@ -0,0 +1,55 @@ +--- 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 +@@ -28,6 +28,12 @@ + #include "kglobal.h" + #include "kglobal_p.h" + ++#include ++ ++#ifdef HAVE_SYS_STAT_H ++#include ++#endif ++ + #include + #include + +@@ -40,6 +46,7 @@ + #include + #include + #include "kcmdlineargs.h" ++#include // umask + + #ifndef NDEBUG + #define MYASSERT(x) if (!x) \ +@@ -55,6 +62,7 @@ + Q_CONSTRUCTOR_FUNCTION(qrand) + + typedef QSet KStringDict; ++mode_t s_umsk; + + class KGlobalPrivate + { +@@ -64,6 +72,10 @@ + locale(0), + charsets(0) + { ++ // the umask is read here before any threads are created to avoid race conditions ++ mode_t tmp = 0; ++ s_umsk = umask(tmp); ++ umask(s_umsk); + } + + inline ~KGlobalPrivate() +@@ -151,6 +163,12 @@ + return d->charsets; + } + ++mode_t KGlobal::umask() ++{ ++ // Don't use PRIVATE_DATA here. This is called by ~KGlobalPrivate -> ~KConfig -> sync -> KSaveFile, so there's no KGlobalPrivate anymore. ++ return s_umsk; ++} ++ + KComponentData KGlobal::activeComponent() + { + PRIVATE_DATA; diff --git a/kdelibs.spec b/kdelibs.spec index e078068..1f863a7 100644 --- a/kdelibs.spec +++ b/kdelibs.spec @@ -1,7 +1,7 @@ Summary: K Desktop Environment 4 - Libraries Version: 4.0.3 -Release: 4%{?dist} +Release: 5%{?dist} %if 0%{?fedora} > 8 Name: kdelibs @@ -80,6 +80,11 @@ Patch13: kdelibs-4.0.3-fedora-buildtype.patch # patch KStandardDirs to use %{_libexecdir}/kde4 instead of %{_libdir}/kde4/libexec Patch14: kdelibs-4.0.3-libexecdir.patch +## upstream patches +# 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 + BuildRequires: qt4-devel >= 4.3.0 Requires: qt4 >= %{_qt4_version} Requires: xdg-utils @@ -199,6 +204,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 + %build @@ -358,6 +365,9 @@ rm -rf %{buildroot} %changelog +* Fri Apr 4 2008 Rex Dieter 4.0.3-5 +- kconfig_sync_crash patch + * Thu Apr 3 2008 Lukáš Tinkl 4.0.3-4 - rebuild for the new %%{_kde4_buildtype}