diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-06-28 15:09:18 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-06-28 15:09:18 +0100 |
| commit | 8b43cf3ff563d8c59ea4109c0b79cc748d015bc7 (patch) | |
| tree | 4b1bb00b8834e1944ef9da284137f9f6ed55ecee /src | |
| parent | f125bce3926f2ae57e4a7bc4351e10104459de31 (diff) | |
| parent | 648efa8eb736011c9324f024bd9981ba04348114 (diff) | |
| download | rabbitmq-server-git-8b43cf3ff563d8c59ea4109c0b79cc748d015bc7.tar.gz | |
merge default
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_file.erl | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index eca1017cfc..e3ed411341 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -511,7 +511,7 @@ basic_consume(#amqqueue{pid = QPid}, NoAck, ChPid, Limiter, Limiter, ConsumerTag, ExclusiveConsume, OkMsg}). basic_cancel(#amqqueue{pid = QPid}, ChPid, ConsumerTag, OkMsg) -> - ok = delegate_call(QPid, {basic_cancel, ChPid, ConsumerTag, OkMsg}). + delegate_call(QPid, {basic_cancel, ChPid, ConsumerTag, OkMsg}). notify_sent(QPid, ChPid) -> Key = {consumer_credit_to, QPid}, diff --git a/src/rabbit_file.erl b/src/rabbit_file.erl index 5937a335b5..a95f8f269d 100644 --- a/src/rabbit_file.erl +++ b/src/rabbit_file.erl @@ -168,7 +168,24 @@ make_binary(List) -> {error, Reason} end. +%% TODO the semantics of this function are rather odd. But see bug 25021. append_file(File, Suffix) -> + case read_file_info(File) of + {ok, FInfo} -> append_file(File, FInfo#file_info.size, Suffix); + {error, enoent} -> append_file(File, 0, Suffix); + Error -> Error + end. + +append_file(_, _, "") -> + ok; +append_file(File, 0, Suffix) -> + with_fhc_handle(fun () -> + case prim_file:open([File, Suffix], [append]) of + {ok, Fd} -> prim_file:close(Fd); + Error -> Error + end + end); +append_file(File, _, Suffix) -> case with_fhc_handle(2, fun () -> file:copy(File, {[File, Suffix], [append]}) end) of |
