summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2010-07-01 20:46:29 +0000
committerDamien F. Katz <damien@apache.org>2010-07-01 20:46:29 +0000
commitc4a2f52b046464fd0a34ac497925ec7b424b7cf6 (patch)
treea7c20a85b51c14c58525271138ee97d56e94d065
parent559f1d81b97071ed868e37405da7664096abc49f (diff)
Fix for windows fsync, race conditions in attachments.js and the default shell used when launching windows CouchDB.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@959781 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--bin/couchdb.bat.tpl.in4
-rw-r--r--share/www/script/test/changes.js8
-rw-r--r--src/couchdb/couch_file.erl2
3 files changed, 10 insertions, 4 deletions
diff --git a/bin/couchdb.bat.tpl.in b/bin/couchdb.bat.tpl.in
index 2f16b2a7..369f1d81 100644
--- a/bin/couchdb.bat.tpl.in
+++ b/bin/couchdb.bat.tpl.in
@@ -17,8 +17,8 @@ rem First change to the drive with the erlang bin directory
rem then change to the erlang bin directory
cd %~dp0
-rem Allow a different erlang executable (eg, werl) to be used.
-if "%ERL%x" == "x" set ERL=erl.exe
+rem Allow a different erlang executable (eg, erl) to be used.
+if "%ERL%x" == "x" set ERL=werl.exe
echo CouchDB %version% - prepare to relax...
%ERL% -sasl errlog_type error -s couch
diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
index b8e691b3..50649508 100644
--- a/share/www/script/test/changes.js
+++ b/share/www/script/test/changes.js
@@ -88,7 +88,10 @@ couchTests.changes = function(debug) {
waitForSuccess(function() {
lines = xhr.responseText.split("\n");
change1 = JSON.parse(lines[0]);
- change2 = JSON.parse(lines[1]);
+ change2 = JSON.parse(lines[1]);
+ if (change2.seq != 2) {
+ throw "bad seq, try again"
+ }
}, "bar-only");
T(change1.seq == 1)
@@ -106,6 +109,9 @@ couchTests.changes = function(debug) {
waitForSuccess(function() {
lines = xhr.responseText.split("\n");
change3 = JSON.parse(lines[2]);
+ if (change3.seq != 3) {
+ throw "bad seq, try again"
+ }
});
T(change3.seq == 3);
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index 8c82272d..6671bcc1 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -148,7 +148,7 @@ truncate(Fd, Pos) ->
%%----------------------------------------------------------------------
sync(Filepath) when is_list(Filepath) ->
- {ok, Fd} = file:open(Filepath, [read, raw]),
+ {ok, Fd} = file:open(Filepath, [append, raw]),
try file:sync(Fd) after file:close(Fd) end;
sync(Fd) ->
gen_server:call(Fd, sync, infinity).