* Fri Apr 4 2008 Rex Dieter <rdieter@fedoraproject.org> 4.0.3-5

- kconfig_sync_crash patch
This commit is contained in:
Rex Dieter 2008-04-04 12:13:52 +00:00
parent 5108013273
commit 44f46e09dc
2 changed files with 66 additions and 1 deletions

View File

@ -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 <config.h>
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
#include <QtCore/QList>
#include <QtCore/QSet>
@@ -40,6 +46,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QTextCodec>
#include "kcmdlineargs.h"
+#include <unistd.h> // umask
#ifndef NDEBUG
#define MYASSERT(x) if (!x) \
@@ -55,6 +62,7 @@
Q_CONSTRUCTOR_FUNCTION(qrand)
typedef QSet<QString> 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;

View File

@ -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 <rdieter@fedoraproject.org> 4.0.3-5
- kconfig_sync_crash patch
* Thu Apr 3 2008 Lukáš Tinkl <ltinkl@redhat.com> 4.0.3-4
- rebuild for the new %%{_kde4_buildtype}