summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/dbwrap/dbwrap_ntdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/dbwrap/dbwrap_ntdb.c b/lib/dbwrap/dbwrap_ntdb.c
index 5be7b842e2..658c487341 100644
--- a/lib/dbwrap/dbwrap_ntdb.c
+++ b/lib/dbwrap/dbwrap_ntdb.c
@@ -326,7 +326,9 @@ static int timeout_lock(int fd, int rw, off_t off, off_t len, bool waitflag,
}
alarm(0);
- errno = saved_errno;
+ if (ret != 0) {
+ errno = saved_errno;
+ }
return ret;
}