From a645dd4b91f12b4c07bb53d9a7946a6796e2a3f5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 4 Mar 2011 18:39:38 -0800 Subject: [PATCH] Bug 634666 - File streams perform disk I/O when being initialized. r=philikon a=blocking-fennec --- services/sync/modules/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/sync/modules/util.js b/services/sync/modules/util.js index a774f0e144a6..4c2fedbc6e97 100644 --- a/services/sync/modules/util.js +++ b/services/sync/modules/util.js @@ -1140,7 +1140,8 @@ let Utils = { let fos = Cc["@mozilla.org/network/safe-file-output-stream;1"] .createInstance(Ci.nsIFileOutputStream); - fos.init(file, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE, PERMS_FILE, 0); + fos.init(file, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE, PERMS_FILE, + fos.DEFER_OPEN || 0); let is = this._utf8Converter.convertToInputStream(out); NetUtil.asyncCopy(is, fos, function (result) { if (typeof callback == "function") {