From 89fc597aa42f945fcd124ae64accb2f1fc98877a Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 21 Jul 2011 23:01:13 +0000 Subject: [PATCH] nsIFile.isSpecial() is not implemented on Fx 3.6, but we can still use nsIFile.isFile() to determine whether or not this is a pipe. Ugh. --- chrome/content/zotero/xpcom/integration.js | 1 + chrome/content/zotero/xpcom/ipc.js | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 3ab183203..e8d91c87c 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -95,6 +95,7 @@ Zotero.Integration = new function() { } catch (e) { // if pipe can't be deleted, log an error Zotero.debug("Error removing old integration pipe", 1); + Zotero.logError(e); Components.utils.reportError( "Zotero word processor integration initialization failed. " + "See http://forums.zotero.org/discussion/12054/#Item_10 " diff --git a/chrome/content/zotero/xpcom/ipc.js b/chrome/content/zotero/xpcom/ipc.js index 85763f01d..6d74366d5 100755 --- a/chrome/content/zotero/xpcom/ipc.js +++ b/chrome/content/zotero/xpcom/ipc.js @@ -99,7 +99,7 @@ Zotero.IPC = new function() { // Also append to plain files to get things working with Fx 3.6 polling // On OS X, O_APPEND = 0x0008 // On Linux, O_APPEND = 00002000 - if(!pipe.isSpecial()) mode = mode | (Zotero.isMac ? 0x0008 : 00002000); + if(pipe.isFile()) mode = mode | (Zotero.isMac ? 0x0008 : 00002000); var fd = open(pipe.path, mode); if(fd === -1) return false; @@ -222,9 +222,9 @@ Zotero.IPC = new function() { var defunct = false; - if(!pipe.isSpecial()) { + if(pipe.isFile()) { // not actually a pipe - if(!pipe.isFile()) { + if(pipe.isDirectory()) { // not a file, so definitely defunct defunct = true; } else { @@ -523,7 +523,8 @@ Zotero.IPC.Pipe.Poll = function(file, callback) { Zotero.IPC.Pipe.Poll._activePipes.push(this); // add shutdown listener - Zotero.addShutdownListener(this); + var me = this; + Zotero.addShutdownListener(function() { me._clearFile() }); } Zotero.IPC.Pipe.Poll._activePipes = [];