summaryrefslogtreecommitdiffstats
path: root/source/tdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-12-13 02:34:43 +0000
committerJeremy Allison <jra@samba.org>2001-12-13 02:34:43 +0000
commit1d2504b5c76bf23ac49a401adce8a49f193bc22c (patch)
tree0d1963ac79961726e7f3f730680fe8887fa6b71b /source/tdb
parent216dff438095781934b57fd097ed118daf5fffa0 (diff)
downloadsamba-1d2504b5c76bf23ac49a401adce8a49f193bc22c.tar.gz
samba-1d2504b5c76bf23ac49a401adce8a49f193bc22c.tar.xz
samba-1d2504b5c76bf23ac49a401adce8a49f193bc22c.zip
Must check against -1 for fcntl error check.
Jeremy
Diffstat (limited to 'source/tdb')
-rw-r--r--source/tdb/tdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index ec5565a40f8..28425c29892 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -175,10 +175,10 @@ static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset,
fl.l_len = 1;
fl.l_pid = 0;
- if (fcntl(tdb->fd,lck_type,&fl)) {
+ if (fcntl(tdb->fd,lck_type,&fl) == -1) {
if (!probe) {
- TDB_LOG((tdb, 5,"tdb_brlock failed at offset %d rw_type=%d lck_type=%d\n",
- offset, rw_type, lck_type));
+ TDB_LOG((tdb, 5,"tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d\n",
+ tdb->fd, offset, rw_type, lck_type));
}
/* errno set by fcntl */
return TDB_ERRCODE(TDB_ERR_LOCK, -1);
@@ -202,7 +202,7 @@ static int tdb_lock(TDB_CONTEXT *tdb, int list, int ltype)
if (tdb->locked[list+1].count == 0) {
if (!tdb->read_only && tdb->header.rwlocks) {
if (tdb_spinlock(tdb, list, ltype)) {
- TDB_LOG((tdb, 0, "tdb_lock spinlock on list ltype=%d\n",
+ TDB_LOG((tdb, 0, "tdb_lock spinlock failed on list ltype=%d\n",
list, ltype));
return -1;
}