diff options
author | Jeremy Allison <jra@samba.org> | 2001-12-13 02:34:43 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-12-13 02:34:43 +0000 |
commit | e0d3a9e443fccf6784ef6b0e180e11056dd0686d (patch) | |
tree | 28bd72ec736f810ec36cb3ce2d8bd1a0d78184b6 /source3/tdb | |
parent | 23b239625ced6b72d0ae30d2e0fec2dbdf680e0b (diff) | |
download | samba-e0d3a9e443fccf6784ef6b0e180e11056dd0686d.tar.gz samba-e0d3a9e443fccf6784ef6b0e180e11056dd0686d.tar.bz2 samba-e0d3a9e443fccf6784ef6b0e180e11056dd0686d.zip |
Must check against -1 for fcntl error check.
Jeremy
(This used to be commit 1d2504b5c76bf23ac49a401adce8a49f193bc22c)
Diffstat (limited to 'source3/tdb')
-rw-r--r-- | source3/tdb/tdb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index ec5565a40f..28425c2989 100644 --- a/source3/tdb/tdb.c +++ b/source3/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; } |