From 6d69dd9ae223d4793add7f959ef60e4533df7c14 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 1 Feb 2004 10:55:54 +0000 Subject: Don't log an error in tdb_brlock() if a non-blocking lock returns EAGAIN - it's supposed to do that. (This used to be commit 2423a459471136d701b498ff0db797c70c6d0fce) --- source3/tdb/tdb.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index ff70750385..7ad39175ac 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -242,10 +242,14 @@ static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset, tdb->fd, offset, rw_type, lck_type)); return TDB_ERRCODE(TDB_ERR_LOCK_TIMEOUT, -1); } - /* Otherwise - generic lock error. */ - /* errno set by fcntl */ - TDB_LOG((tdb, 5, "tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d: %s\n", - tdb->fd, offset, rw_type, lck_type, strerror(errno))); + /* Otherwise - generic lock error. errno set by fcntl. + * EAGAIN is an expected return from non-blocking + * locks. */ + if (errno != EAGAIN) { + TDB_LOG((tdb, 5, "tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d: %s\n", + tdb->fd, offset, rw_type, lck_type, + strerror(errno))); + } return TDB_ERRCODE(TDB_ERR_LOCK, -1); } return 0; -- cgit