diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-10-25 11:26:05 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-10-25 11:26:05 -0700 |
commit | 61ccaf9a974bedf54622a1d6ad6b6ad00f95f5a5 (patch) | |
tree | 1dc52d619bd9ad2424bae83d66c837e7eea6ba06 /lib/fs.js | |
parent | f153d6da450b6ba5c78381e6e90a7ba243657691 (diff) | |
parent | 21265e20d3be515733418c5eef395ccec8f5f701 (diff) | |
download | nodejs-61ccaf9a974bedf54622a1d6ad6b6ad00f95f5a5.tar.gz nodejs-61ccaf9a974bedf54622a1d6ad6b6ad00f95f5a5.tar.bz2 nodejs-61ccaf9a974bedf54622a1d6ad6b6ad00f95f5a5.zip |
Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
ChangeLog
deps/uv/ChangeLog
deps/uv/include/uv-darwin.h
deps/uv/src/unix/fsevents.c
deps/uv/src/unix/process.c
deps/uv/src/version.c
doc/api/addons.markdown
doc/api/cluster.markdown
doc/api/http.markdown
lib/http.js
lib/tls.js
src/node_crypto.cc
src/node_http_parser.cc
src/node_version.h
src/pipe_wrap.cc
src/v8abbr.h
src/v8ustack.d
test/simple/test-http-pipeline-flood.js
Diffstat (limited to 'lib/fs.js')
-rw-r--r-- | lib/fs.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -543,7 +543,7 @@ fs.truncate = function(path, len, callback) { len = 0; } callback = maybeCallback(callback); - fs.open(path, 'w', function(er, fd) { + fs.open(path, 'r+', function(er, fd) { if (er) return callback(er); binding.ftruncate(fd, len, function(er) { fs.close(fd, function(er2) { @@ -562,7 +562,7 @@ fs.truncateSync = function(path, len) { len = 0; } // allow error to be thrown, but still close fd. - var fd = fs.openSync(path, 'w'); + var fd = fs.openSync(path, 'r+'); try { var ret = fs.ftruncateSync(fd, len); } finally { |