rpms/xulrunner/F-9 mozilla-fsync.patch, NONE, 1.1 xulrunner.spec, 1.124, 1.125

Christopher Aillon (caillon) fedora-extras-commits at redhat.com
Thu May 22 19:15:08 UTC 2008


Author: caillon

Update of /cvs/extras/rpms/xulrunner/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13182

Modified Files:
	xulrunner.spec 
Added Files:
	mozilla-fsync.patch 
Log Message:
* Thu May 22 2008 Christopher Aillon <caillon at redhat.com> 1.0-0.62
- Upstream patch to fsync() less


mozilla-fsync.patch:

--- NEW FILE mozilla-fsync.patch ---
diff --git a/storage/src/mozStorageConnection.cpp b/storage/src/mozStorageConnection.cpp
--- a/storage/src/mozStorageConnection.cpp
+++ b/storage/src/mozStorageConnection.cpp
@@ -48,6 +48,8 @@
 #include "nsAutoPtr.h"
 #include "nsIFile.h"
 #include "nsIVariant.h"
+#include "nsIPrefService.h"
+#include "nsIPrefBranch.h"
 
 #include "mozIStorageAggregateFunction.h"
 #include "mozIStorageFunction.h"
@@ -65,6 +67,8 @@
 #ifdef PR_LOGGING
 PRLogModuleInfo* gStorageLog = nsnull;
 #endif
+
+#define PREF_TS_SYNCHRONOUS "toolkit.storage.synchronous"
 
 NS_IMPL_ISUPPORTS1(mozStorageConnection, mozIStorageConnection)
 
@@ -155,6 +159,28 @@ mozStorageConnection::Initialize(nsIFile
         mDBConn = nsnull;
 
         return ConvertResultCode(srv);
+    }
+
+    // Set the synchronous PRAGMA, according to the pref
+    nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
+    PRInt32 synchronous = 1; // Default to NORMAL if pref not set
+    if (pref)
+        (void)pref->GetIntPref(PREF_TS_SYNCHRONOUS, &synchronous);
+    
+    switch (synchronous) {
+        case 2:
+            (void)ExecuteSimpleSQL(NS_LITERAL_CSTRING(
+                "PRAGMA synchronous = FULL;"));
+            break;
+        case 0:
+            (void)ExecuteSimpleSQL(NS_LITERAL_CSTRING(
+                "PRAGMA synchronous = OFF;"));
+            break;
+        case 1:
+        default:
+            (void)ExecuteSimpleSQL(NS_LITERAL_CSTRING(
+                "PRAGMA synchronous = NORMAL;"));
+            break;
     }
 
     return NS_OK;
diff --git a/storage/test/unit/test_storage_connection.js b/storage/test/unit/test_storage_connection.js
--- a/storage/test/unit/test_storage_connection.js
+++ b/storage/test/unit/test_storage_connection.js
@@ -197,6 +197,20 @@ function test_createTable(){
   }
 }
 
+function test_defaultSynchronousAtNormal()
+{
+  var msc = getOpenedDatabase();
+  var stmt = createStatement("PRAGMA synchronous;");
+  try {
+    stmt.executeStep();
+    do_check_eq(1, stmt.getInt32(0));
+  }
+  finally {
+    stmt.reset();
+    stmt.finalize();
+  }
+}
+
 var tests = [
   test_connectionReady_open,
   test_connectionReady_closed,
@@ -216,6 +230,7 @@ var tests = [
   test_set_schemaVersion_same,
   test_set_schemaVersion_negative,
   test_createTable,
+  test_defaultSynchronousAtNormal,
 ];
 
 function run_test()


Index: xulrunner.spec
===================================================================
RCS file: /cvs/extras/rpms/xulrunner/F-9/xulrunner.spec,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- xulrunner.spec	8 May 2008 20:36:18 -0000	1.124
+++ xulrunner.spec	22 May 2008 19:14:28 -0000	1.125
@@ -10,7 +10,7 @@
 Summary:        XUL Runtime for Gecko Applications
 Name:           xulrunner
 Version:        1.9
-Release:        0.61%{?version_pre}%{?dist}
+Release:        0.62%{?version_pre}%{?dist}
 URL:            http://www.mozilla.org/projects/xulrunner/
 License:        MPLv1.1 or GPLv2+ or LGPLv2+
 Group:          Applications/Internet
@@ -34,6 +34,7 @@
 Patch22:        mozilla-keys.patch
 Patch23:        xulrunner-hang.patch
 Patch24:        mozilla-resolution.patch
+Patch25:        mozilla-fsync.patch
 
 
 # ---------------------------------------------------
@@ -108,6 +109,7 @@
 %patch22 -p1 -b .keys
 %patch23 -p1 -b .hang
 %patch24 -p1 -b .resolution
+%patch25 -p1 -b .fsync
 
 %{__rm} -f .mozconfig
 %{__cp} %{SOURCE10} .mozconfig
@@ -380,6 +382,9 @@
 #---------------------------------------------------------------------
 
 %changelog
+* Thu May 22 2008 Christopher Aillon <caillon at redhat.com> 1.0-0.62
+- Upstream patch to fsync() less
+
 * Thu May 08 2008 Colin Walters <walters at redhat.com> 1.0-0.61
 - Ensure we enable startup notification; add BR and modify config
   (bug #445543)




More information about the fedora-extras-commits mailing list