Permalink
Browse files

Fix case where ReadStream is created out of path.

  • Loading branch information...
1 parent 442337b commit 3231487903b13f0b1fd78e960ade21137d0878f5 @Gozala committed May 13, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/fs.js
View
@@ -146,10 +146,10 @@ const WriteStream = OutputStream.extend({
if ('position' in options && options.position !== undefined)
this.position = options.position;
- let { mode, flags, position } = this;
+ let { position } = this;
// If pass was passed we create a file descriptor out of it. Otherwise
// we just use given file descriptor.
- let { output } = isString(path) ? openSync(path, flags, mode) : _(path);
+ let { output } = _(isString(path) ? openSync(path, flags, mode) : path);
// Setting a stream position, unless it's `-1` which means current position.
if (position >= 0)
output.QueryInterface(Ci.nsISeekableStream).seek(NS_SEEK_SET, position);

0 comments on commit 3231487

Please sign in to comment.