From: Stefan Metzmacher Date: Thu, 22 Jan 2009 09:54:12 +0000 (+0100) Subject: lib/tdb: if we know pwrite and pread are thread/fork safe tdb_reopen_all() should... X-Git-Tag: samba-4.0.0alpha7~9 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=e17df483fbedb81aededdef5fbb6ae1d034bc2dd lib/tdb: if we know pwrite and pread are thread/fork safe tdb_reopen_all() should be a noop The reason for tdb_reopen_all() is that the seek pointer on fds are shared between parent and child. metze --- diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index b19e4cea293..e58c8ca7ff3 100644 --- a/lib/tdb/common/open.c +++ b/lib/tdb/common/open.c @@ -461,6 +461,10 @@ fail: /* reopen all tdb's */ int tdb_reopen_all(int parent_longlived) { +#if defined(LIBREPLACE_PREAD_NOT_REPLACED) && \ + defined(LIBREPLACE_PWRITE_NOT_REPLACED) + return 0; +#else struct tdb_context *tdb; for (tdb=tdbs; tdb; tdb = tdb->next) { @@ -483,6 +487,7 @@ int tdb_reopen_all(int parent_longlived) if (tdb_reopen(tdb) != 0) return -1; } +#endif return 0; }