only use deferred open for integration pipe on OS X, since it doesn't seem to work on Linux
This commit is contained in:
parent
bb5db25dad
commit
09d1c36791
1 changed files with 6 additions and 3 deletions
|
@ -41,6 +41,7 @@ Zotero.Integration = new function() {
|
||||||
var _osascriptFile;
|
var _osascriptFile;
|
||||||
var _inProgress = false;
|
var _inProgress = false;
|
||||||
var _integrationVersionsOK = null;
|
var _integrationVersionsOK = null;
|
||||||
|
var _useDeferredOpenForIntegrationPipe = false;
|
||||||
var _winUser32;
|
var _winUser32;
|
||||||
|
|
||||||
this.sessions = {};
|
this.sessions = {};
|
||||||
|
@ -255,7 +256,7 @@ Zotero.Integration = new function() {
|
||||||
* Initializes the nsIInputStream and nsIInputStreamPump to read from _fifoFile
|
* Initializes the nsIInputStream and nsIInputStreamPump to read from _fifoFile
|
||||||
*/
|
*/
|
||||||
function _initializePipeStreamPump() {
|
function _initializePipeStreamPump() {
|
||||||
if(Zotero.isFx4) {
|
if(_useDeferredOpenForIntegrationPipe) {
|
||||||
// Fx 4 supports deferred open; no need to use sh
|
// Fx 4 supports deferred open; no need to use sh
|
||||||
var fifoStream = Components.classes["@mozilla.org/network/file-input-stream;1"].
|
var fifoStream = Components.classes["@mozilla.org/network/file-input-stream;1"].
|
||||||
createInstance(Components.interfaces.nsIFileInputStream);
|
createInstance(Components.interfaces.nsIFileInputStream);
|
||||||
|
@ -277,6 +278,8 @@ Zotero.Integration = new function() {
|
||||||
* Initializes the Zotero Integration Pipe
|
* Initializes the Zotero Integration Pipe
|
||||||
*/
|
*/
|
||||||
function _initializeIntegrationPipe() {
|
function _initializeIntegrationPipe() {
|
||||||
|
_useDeferredOpenForIntegrationPipe = Zotero.isMac && Zotero.isFx4;
|
||||||
|
|
||||||
// make a new pipe
|
// make a new pipe
|
||||||
var mkfifo = Components.classes["@mozilla.org/file/local;1"].
|
var mkfifo = Components.classes["@mozilla.org/file/local;1"].
|
||||||
createInstance(Components.interfaces.nsILocalFile);
|
createInstance(Components.interfaces.nsILocalFile);
|
||||||
|
@ -297,7 +300,7 @@ Zotero.Integration = new function() {
|
||||||
proc.run(true, [_fifoFile.path], 1);
|
proc.run(true, [_fifoFile.path], 1);
|
||||||
|
|
||||||
if(_fifoFile.exists()) {
|
if(_fifoFile.exists()) {
|
||||||
if(Zotero.isFx36) {
|
if(!_useDeferredOpenForIntegrationPipe) {
|
||||||
// no deferred open capability, so we need to use the sh/tmpfile hack
|
// no deferred open capability, so we need to use the sh/tmpfile hack
|
||||||
|
|
||||||
// make a tmp file
|
// make a tmp file
|
||||||
|
@ -438,7 +441,7 @@ Zotero.Integration = new function() {
|
||||||
oStream.write(cmd, cmd.length);
|
oStream.write(cmd, cmd.length);
|
||||||
oStream.close();
|
oStream.close();
|
||||||
_fifoFile.remove(false);
|
_fifoFile.remove(false);
|
||||||
if(Zotero.isFx36) _tmpFile.remove(false);
|
if(!__useDeferredOpenForIntegrationPipe) _tmpFile.remove(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue