From 47739f3a75b247db446eb863ab6d83d6ca461634 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Thu, 24 Sep 2015 16:38:03 +0200 Subject: Change perm interface to be add/commit based --- src/util.erl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/util.erl') diff --git a/src/util.erl b/src/util.erl index 2125d5e..c3b30db 100644 --- a/src/util.erl +++ b/src/util.erl @@ -2,7 +2,7 @@ %%% See LICENSE for licensing information. -module(util). --export([tempfilename/1, fsync/1, exit_with_error/3, +-export([tempfilename/1, fsync/1, fsync/2, exit_with_error/3, check_error/3, write_tempfile_and_rename/3, spawn_and_wait/1]). @@ -14,14 +14,17 @@ tempfilename(Base) -> Filename. -spec fsync([string()]) -> ok. -fsync(Paths) -> - case fsyncport:fsyncall(Paths) of +fsync(Paths, Timeout) -> + case fsyncport:fsyncall(Paths, Timeout) of ok -> ok; {error, Error} -> exit_with_error(fsync, Error, "Error in fsync") end. +fsync(Paths) -> + fsync(Paths, 5000). + -spec exit_with_error(atom(), atom(), string()) -> no_return(). exit_with_error(Operation, Error, ErrorMessage) -> io:format("~s(~w): ~w~n", [ErrorMessage, Operation, Error]), -- cgit v1.1