diff options
Diffstat (limited to 'bdb/os/os_rw.c')
-rw-r--r-- | bdb/os/os_rw.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/bdb/os/os_rw.c b/bdb/os/os_rw.c index 7e8e1255d6b..9a79342c7b8 100644 --- a/bdb/os/os_rw.c +++ b/bdb/os/os_rw.c @@ -1,14 +1,14 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997, 1998, 1999, 2000 + * Copyright (c) 1997-2002 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint -static const char revid[] = "$Id: os_rw.c,v 11.15 2000/11/15 19:25:39 sue Exp $"; +static const char revid[] = "$Id: os_rw.c,v 11.24 2002/07/12 18:56:52 bostic Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -19,7 +19,6 @@ static const char revid[] = "$Id: os_rw.c,v 11.15 2000/11/15 19:25:39 sue Exp $" #endif #include "db_int.h" -#include "os_jump.h" /* * __os_io -- @@ -39,13 +38,13 @@ __os_io(dbenv, db_iop, op, niop) #if defined(HAVE_PREAD) && defined(HAVE_PWRITE) switch (op) { case DB_IO_READ: - if (__db_jump.j_read != NULL) + if (DB_GLOBAL(j_read) != NULL) goto slow; *niop = pread(db_iop->fhp->fd, db_iop->buf, db_iop->bytes, (off_t)db_iop->pgno * db_iop->pagesize); break; case DB_IO_WRITE: - if (__db_jump.j_write != NULL) + if (DB_GLOBAL(j_write) != NULL) goto slow; *niop = pwrite(db_iop->fhp->fd, db_iop->buf, db_iop->bytes, (off_t)db_iop->pgno * db_iop->pagesize); @@ -98,10 +97,11 @@ __os_read(dbenv, fhp, addr, len, nrp) for (taddr = addr, offset = 0; offset < len; taddr += nr, offset += nr) { - if ((nr = __db_jump.j_read != NULL ? - __db_jump.j_read(fhp->fd, taddr, len - offset) : +retry: if ((nr = DB_GLOBAL(j_read) != NULL ? + DB_GLOBAL(j_read)(fhp->fd, taddr, len - offset) : read(fhp->fd, taddr, len - offset)) < 0) { - ret = __os_get_errno(); + if ((ret = __os_get_errno()) == EINTR) + goto retry; __db_err(dbenv, "read: 0x%x, %lu: %s", taddr, (u_long)len-offset, strerror(ret)); return (ret); @@ -134,10 +134,11 @@ __os_write(dbenv, fhp, addr, len, nwp) for (taddr = addr, offset = 0; offset < len; taddr += nw, offset += nw) - if ((nw = __db_jump.j_write != NULL ? - __db_jump.j_write(fhp->fd, taddr, len - offset) : +retry: if ((nw = DB_GLOBAL(j_write) != NULL ? + DB_GLOBAL(j_write)(fhp->fd, taddr, len - offset) : write(fhp->fd, taddr, len - offset)) < 0) { - ret = __os_get_errno(); + if ((ret = __os_get_errno()) == EINTR) + goto retry; __db_err(dbenv, "write: 0x%x, %lu: %s", taddr, (u_long)len-offset, strerror(ret)); return (ret); |