[SCM] Samba Shared Repository - branch master updated
Günther Deschner
gd at samba.org
Wed Apr 27 09:58:03 MDT 2011
The branch, master has been updated
via 66b2619 s3-waf: add pthreadpool support.
via cad8faf s3-waf: check for pthread support.
via ee0b0dd s3-netapi: Fix Coverity CID #2302: FORWARD_NULL
from 1d46325 Remove outdated S4 OpenLDAP backend HOWTO.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 66b26195d21f0889e7ccd0de25a5827bb3722196
Author: Günther Deschner <gd at samba.org>
Date: Wed Apr 27 13:16:59 2011 +0200
s3-waf: add pthreadpool support.
Volker, please check.
Guenther
Autobuild-User: Günther Deschner <gd at samba.org>
Autobuild-Date: Wed Apr 27 17:57:32 CEST 2011 on sn-devel-104
commit cad8fafa0391e9f13c2958c45ca5ec57f93f1e7b
Author: Günther Deschner <gd at samba.org>
Date: Wed Apr 27 16:07:35 2011 +0200
s3-waf: check for pthread support.
Guenther
commit ee0b0dd3a150dea35ef57d5867519a7df382137c
Author: Günther Deschner <gd at samba.org>
Date: Wed Apr 27 15:41:49 2011 +0200
s3-netapi: Fix Coverity CID #2302: FORWARD_NULL
Guenther
-----------------------------------------------------------------------
Summary of changes:
source3/lib/netapi/localgroup.c | 2 +-
source3/lib/pthreadpool/wscript_build | 11 +++++++++
source3/wscript | 38 +++++++++++++++++++++++++++++++++
source3/wscript_build | 7 ++---
4 files changed, 53 insertions(+), 5 deletions(-)
create mode 100644 source3/lib/pthreadpool/wscript_build
Changeset truncated at 500 lines:
diff --git a/source3/lib/netapi/localgroup.c b/source3/lib/netapi/localgroup.c
index 51f4e1d..49ba74e 100644
--- a/source3/lib/netapi/localgroup.c
+++ b/source3/lib/netapi/localgroup.c
@@ -1344,7 +1344,7 @@ static WERROR NetLocalGroupModifyMembers_r(struct libnetapi_ctx *ctx,
werr = WERR_OK;
done:
- if (is_valid_policy_hnd(&alias_handle)) {
+ if (b && is_valid_policy_hnd(&alias_handle)) {
dcerpc_samr_Close(b, talloc_tos(), &alias_handle, &result);
}
diff --git a/source3/lib/pthreadpool/wscript_build b/source3/lib/pthreadpool/wscript_build
new file mode 100644
index 0000000..7679b58
--- /dev/null
+++ b/source3/lib/pthreadpool/wscript_build
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+bld.SAMBA3_SUBSYSTEM('PTHREADPOOL',
+ source='pthreadpool.c',
+ deps='pthread',
+ enabled=bld.env.WITH_PTHREADPOOL)
+
+bld.SAMBA3_BINARY('pthreadpooltest',
+ source='tests.c',
+ deps='PTHREADPOOL',
+ enabled=bld.env.WITH_PTHREADPOOL)
diff --git a/source3/wscript b/source3/wscript
index 45e60aa..7f178a4 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1637,6 +1637,44 @@ main() {
if Options.options.with_profiling_data:
conf.DEFINE('WITH_PROFILE', 1);
+ PTHREAD_CFLAGS='error'
+ PTHREAD_LDFLAGS='error'
+
+ if PTHREAD_LDFLAGS == 'error':
+ if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthread'):
+ PTHREAD_CFLAGS='-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS'
+ PTHREAD_LDFLAGS='-lpthread'
+ if PTHREAD_LDFLAGS == 'error':
+ if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthreads'):
+ PTHREAD_CFLAGS='-D_THREAD_SAFE'
+ PTHREAD_LDFLAGS='-lpthreads'
+ if PTHREAD_LDFLAGS == 'error':
+ if conf.CHECK_FUNCS_IN('pthread_attr_init', 'c_r'):
+ PTHREAD_CFLAGS='-D_THREAD_SAFE -pthread'
+ PTHREAD_LDFLAGS='-pthread'
+ if PTHREAD_LDFLAGS == 'error':
+ if conf.CHECK_FUNC('pthread_attr_init'):
+ PTHREAD_CFLAGS='-D_REENTRANT'
+ PTHREAD_LDFLAGS='-lpthread'
+ # especially for HP-UX, where the CHECK_FUNC macro fails to test for
+ # pthread_attr_init. On pthread_mutex_lock it works there...
+ if PTHREAD_LDFLAGS == 'error':
+ if conf.CHECK_FUNCS_IN('pthread_mutex_lock', 'pthread'):
+ PTHREAD_CFLAGS='-D_REENTRANT'
+ PTHREAD_LDFLAGS='-lpthread'
+
+ if PTHREAD_CFLAGS != 'error' and PTHREAD_LDFLAGS != 'error':
+ conf.ADD_CFLAGS(PTHREAD_CFLAGS)
+ conf.ADD_LDFLAGS(PTHREAD_LDFLAGS)
+ conf.CHECK_HEADERS('pthread.h')
+ conf.DEFINE('HAVE_PTHREAD', '1')
+
+ if Options.options.with_pthreadpool:
+ if conf.CONFIG_SET('HAVE_PTHREAD'):
+ conf.DEFINE('WITH_PTHREADPOOL', '1')
+ else:
+ Logs.warn("pthreadpool support cannot be enabled when pthread support was not found")
+ conf.undefine('WITH_PTHREADPOOL')
default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam
auth_sam auth_unix auth_winbind auth_wbc auth_server
diff --git a/source3/wscript_build b/source3/wscript_build
index ca37ce3..a6ce559 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -57,8 +57,6 @@ LIBCLI_WINREG_SRC = '''rpc_client/cli_winreg.c
# that requires knowledge of security contexts
REG_PARSE_PRS_SRC = '''registry/reg_parse_prs.c'''
-PTHREADPOOL_SRC = ''
-
LIB_SRC = '''
lib/messages.c lib/messages_local.c
lib/messages_ctdbd.c lib/packet.c lib/ctdbd_conn.c
@@ -91,7 +89,7 @@ LIB_SRC = '''
lib/module.c lib/events.c
lib/server_contexts.c
lib/ldap_escape.c
- lib/secdesc.c ${PTHREADPOOL_SRC}
+ lib/secdesc.c
lib/fncall.c
libads/krb5_errs.c lib/system_smbd.c lib/audit.c
lib/file_id.c lib/idmap_cache.c'''
@@ -780,7 +778,7 @@ bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
bld.SAMBA3_LIBRARY('samba3core',
source=LIB_SRC,
- deps='LIBCRYPTO ndr ndr-util security NDR_SECURITY charset NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 CHARSET3 UTIL_TDB UTIL_PW SAMBA_VERSION krb5 flag_mapping util_reg passdb',
+ deps='LIBCRYPTO ndr ndr-util security NDR_SECURITY charset NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 CHARSET3 UTIL_TDB UTIL_PW SAMBA_VERSION krb5 flag_mapping util_reg passdb PTHREADPOOL',
private_library=True,
vars=locals())
@@ -1361,6 +1359,7 @@ bld.RECURSE('../nsswitch')
bld.RECURSE('../nsswitch/libwbclient')
bld.RECURSE('auth')
bld.RECURSE('libgpo/gpext')
+bld.RECURSE('lib/pthreadpool')
bld.RECURSE('librpc')
bld.RECURSE('librpc/idl')
bld.RECURSE('modules')
--
Samba Shared Repository
More information about the samba-cvs
mailing list