diff options
author | Magnus Ahltorp <map@kth.se> | 2014-10-27 01:24:09 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2014-10-27 01:24:09 +0100 |
commit | 80ea2ac6af8f993888444a4f75bbcc976ddd3973 (patch) | |
tree | 8139e2346b6463f69b21c43c16de4705eb30226b /src/util.erl | |
parent | dc8952f6fefc91e21bacf125f5414edf0d35db55 (diff) |
Parallel fsync
Diffstat (limited to 'src/util.erl')
-rw-r--r-- | src/util.erl | 16 |
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) -> |