Commit 5286ff7c authored by Jan Koester's avatar Jan Koester
Browse files

test

parent 03084d64
Loading
Loading
Loading
Loading
Loading
+8 −2
Changes for src/backends/file.cpp: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
 *******************************************************************************/

#include <cstring>
#include <cerrno>
#include <sstream>
#include <exception>
#include <vector>
@@ -259,7 +260,10 @@ void authdb::File::lock(){

        if (_LockDes == INVALID_HANDLE_VALUE) {
            if (attempt > 100) {
                throw AuthBackendError("couldn't open lockfile: too many retries");
                DWORD error = GetLastError();
                std::string err = "couldn't open lockfile '" + _lockFile +
                    "': too many retries (error code: " + std::to_string(error) + ")";
                throw AuthBackendError(err.c_str());
            }
            Sleep(10);
            continue;
@@ -305,7 +309,9 @@ void authdb::File::lock(){

        if(_LockDes<0){
            if(attempt > 100){
                throw AuthBackendError("couldn't open lockfile: too many retries");
                std::string err = "couldn't open lockfile '" + _lockFile +
                    "': too many retries (" + strerror(errno) + ")";
                throw AuthBackendError(err.c_str());
            }
            usleep(10000);
            continue;