From a48704925d6c3e5c01057192403e55f3663b315c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 14 Dec 2014 21:16:34 +0100 Subject: storage/nfs: add timeout --- src/lib/nfs/Blocking.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/nfs/Blocking.cxx') diff --git a/src/lib/nfs/Blocking.cxx b/src/lib/nfs/Blocking.cxx index 5f769c408..58eaf6af2 100644 --- a/src/lib/nfs/Blocking.cxx +++ b/src/lib/nfs/Blocking.cxx @@ -20,7 +20,9 @@ #include "config.h" #include "Blocking.hxx" #include "Connection.hxx" +#include "Domain.hxx" #include "event/Call.hxx" +#include "util/Error.hxx" bool BlockingNfsOperation::Run(Error &_error) @@ -31,7 +33,10 @@ BlockingNfsOperation::Run(Error &_error) [this](){ connection.AddLease(*this); }); /* wait for completion */ - LockWaitFinished(); + if (!LockWaitFinished()) { + _error.Set(nfs_domain, 0, "Timeout"); + return false; + } /* check for error */ if (error.IsDefined()) { -- cgit v1.2.3