summaryrefslogtreecommitdiff
path: root/src/util.erl
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2014-10-27 01:24:09 +0100
committerMagnus Ahltorp <map@kth.se>2014-10-27 01:24:09 +0100
commit80ea2ac6af8f993888444a4f75bbcc976ddd3973 (patch)
tree8139e2346b6463f69b21c43c16de4705eb30226b /src/util.erl
parentdc8952f6fefc91e21bacf125f5414edf0d35db55 (diff)
Parallel fsync
Diffstat (limited to 'src/util.erl')
-rw-r--r--src/util.erl16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/util.erl b/src/util.erl
index dd42752..435dbc8 100644
--- a/src/util.erl
+++ b/src/util.erl
@@ -13,15 +13,13 @@ tempfilename(Base) ->
Filename.
-spec fsync([string()]) -> ok.
-fsync([]) ->
- ok;
-fsync([Name | Rest]) ->
- case fsyncport:fsync(Name) of
- ok ->
- fsync(Rest);
- {error, Error} ->
- exit_with_error(fsync, Error, "Error in fsync")
- end.
+fsync(Paths) ->
+ case fsyncport:fsyncall(Paths) of
+ ok ->
+ ok;
+ {error, Error} ->
+ exit_with_error(fsync, Error, "Error in fsync")
+ end.
-spec exit_with_error(atom(), atom(), string()) -> no_return().
exit_with_error(Operation, Error, ErrorMessage) ->