summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common/tdb.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-03-13 01:40:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:03 -0500
commit639edc4097d1d5f011ce642b97b522ac4cb8b4ae (patch)
tree36bd33eaf200e0d8af5d616ab52ff6a1d0aae94c /source4/lib/tdb/common/tdb.c
parent1fb7f63aa9ce8b1b1384a7c907fbe1c0bbc9cd92 (diff)
downloadsamba-639edc4097d1d5f011ce642b97b522ac4cb8b4ae.tar.gz
samba-639edc4097d1d5f011ce642b97b522ac4cb8b4ae.tar.bz2
samba-639edc4097d1d5f011ce642b97b522ac4cb8b4ae.zip
r5779: Remove signal and timeout gubbage from tdb.
(This used to be commit dbb56e9a59cf00d57b09ded6d60bf9424d5f1f4c)
Diffstat (limited to 'source4/lib/tdb/common/tdb.c')
-rw-r--r--source4/lib/tdb/common/tdb.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/source4/lib/tdb/common/tdb.c b/source4/lib/tdb/common/tdb.c
index 90b586d487..d9fabaeda9 100644
--- a/source4/lib/tdb/common/tdb.c
+++ b/source4/lib/tdb/common/tdb.c
@@ -61,7 +61,6 @@
#include <errno.h>
#include <sys/mman.h>
#include <sys/stat.h>
-#include <signal.h>
#include "tdb.h"
#else
#include "includes.h"
@@ -193,18 +192,6 @@ struct list_struct {
*/
};
-/***************************************************************
- Allow a caller to set a "alarm" flag that tdb can check to abort
- a blocking lock on SIGALRM.
-***************************************************************/
-
-static sig_atomic_t *palarm_fired;
-
-void tdb_set_lock_alarm(sig_atomic_t *palarm)
-{
- palarm_fired = palarm;
-}
-
/* a byte range locking function - return 0 on success
this functions locks/unlocks 1 byte at the specified offset.
@@ -231,27 +218,16 @@ static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset,
do {
ret = fcntl(tdb->fd,lck_type,&fl);
- if (ret == -1 && errno == EINTR && palarm_fired && *palarm_fired)
- break;
} while (ret == -1 && errno == EINTR);
if (ret == -1) {
if (!probe && lck_type != F_SETLK) {
/* Ensure error code is set for log fun to examine. */
- if (errno == EINTR && palarm_fired && *palarm_fired)
- tdb->ecode = TDB_ERR_LOCK_TIMEOUT;
- else
- tdb->ecode = TDB_ERR_LOCK;
+ tdb->ecode = TDB_ERR_LOCK;
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));
}
- /* Was it an alarm timeout ? */
- if (errno == EINTR && palarm_fired && *palarm_fired) {
- TDB_LOG((tdb, 5, "tdb_brlock timed out (fd=%d) at offset %d rw_type=%d lck_type=%d\n",
- tdb->fd, offset, rw_type, lck_type));
- return TDB_ERRCODE(TDB_ERR_LOCK_TIMEOUT, -1);
- }
- /* Otherwise - generic lock error. errno set by fcntl.
+ /* Generic lock error. errno set by fcntl.
* EAGAIN is an expected return from non-blocking
* locks. */
if (errno != EAGAIN) {