diff options
author | Jeremy Allison <jra@samba.org> | 2002-04-19 02:08:52 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-04-19 02:08:52 +0000 |
commit | 302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1 (patch) | |
tree | f552ee1a194744889de11e042692cd7efe0212fa /source3/tdb/tdb.c | |
parent | dcb572e0b26858f58ddcf5cac1c94be31cda844d (diff) | |
download | samba-302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1.tar.gz samba-302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1.tar.bz2 samba-302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1.zip |
First cut at fix for the EINTR problem... More needs to be done I think.
Jeremy.
(This used to be commit 48475a7a697242b9fd7b1aec24389afb112569c4)
Diffstat (limited to 'source3/tdb/tdb.c')
-rw-r--r-- | source3/tdb/tdb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index 98caca82a1..e3ba1db0d2 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -169,6 +169,7 @@ static int tdb_brlock(TDB_CONTEXT *tdb, tdb_off offset, int rw_type, int lck_type, int probe) { struct flock fl; + int ret; if (tdb->flags & TDB_NOLOCK) return 0; @@ -183,7 +184,12 @@ 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) == -1) { + do { + errno = 0; + ret = fcntl(tdb->fd,lck_type,&fl); + } while (ret == -1 && errno == EINTR); + + if (ret == -1) { if (!probe) { 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)); |