1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

531 Commits

Author SHA1 Message Date
Volker Lendecke
f9d00fb58e Simplify the logic of tsocket_bsd_pending
Remove two indentation levels by returning early on error.

Metze, please check!
2009-05-19 23:35:16 +02:00
Jelmer Vernooij
cf9636ea99 tevent/python: Makefile was still trying to build some non AC_SUBST python targets
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
2009-05-19 23:33:00 +02:00
Jelmer Vernooij
72b744f38e tevent: Define TALLOC_FREE() if it's not defined yet, to allow building
with released versions of talloc.
2009-05-16 20:31:59 +02:00
Jelmer Vernooij
5065cf70f8 tevent: Remove python module.
This module didn't have any functionality that we actually used yet, and
it was quite small.

Tevent is quite low level and perhaps doesn't make much sense to expose
directly as a Python module. It was also causing build problems when used with a
system-tevent. We can always back later if necessary.
2009-05-16 14:56:37 +02:00
Jelmer Vernooij
857c3f8322 tevent: Install tevent_internal.h in the standalone build.
This is not ideal, but at least it fixes the build of samba-gtk for now.
I've also added a warning about API guarantees at the top of the header.
2009-05-16 04:14:21 +02:00
Samuel Thibault
a0caffd446 Fix linker flags on non-Linux GNU platforms.
(e.g. Debian GNU/kFreeBSD)

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-05-16 04:05:53 +02:00
Jelmer Vernooij
6230eb94af Update copies of config.guess and config.sub. 2009-05-16 04:03:12 +02:00
Jelmer Vernooij
06864b4469 tevent: Don't install headers, since we don't install a shared lib
either (from Samba).
2009-05-16 01:54:10 +02:00
Andrew Bartlett
d73eab2b33 Add extensive tests for str_list function behaviour 2009-05-15 01:50:06 +10:00
Volker Lendecke
074890b39e Remove two unused variables 2009-05-14 15:40:57 +02:00
Andrew Bartlett
a89bee4c98 Add new functions and tests: str_list_make_empty(), str_list_make_single() 2009-05-14 05:56:58 +10:00
Derrell Lipman
045af600f2 Take advantage of the easier-to-use thread macros
- Now that we initialize for the non-thread-safe case in the macro, there's no
  need to do it here too.

Derrell
2009-05-13 14:37:28 -04:00
Derrell Lipman
088906b064 Make the thread functions a bit easier to use
- Create separate macros for lock and unlock so that it's easier to identify
  which request is being made.

- Initialize *ponce in the SMB_THREAD_ONCE macro in the non-thread-safe case,
  rather than requiring each init function to determine if it's in the
  non-thread-safe case and manually initialize.

Derrell
2009-05-13 14:37:28 -04:00
Derrell Lipman
e03b9ae609 Allow a parameter to smb_thread_once's initialization function
- This should make life easier for ourselves. We're no longer constrained to
  the semantics of pthread_once, so let's allow passing a parameter to the
  initialization function. Some of Samba's init functions return a
  value. Although I haven't searched, I suspect that some of the init
  functions require in input parameters. The parameter added here can be used
  for input, output, or both, as necessary... or ignored, as is now done in
  talloc_stackframe_init().

Derrell
2009-05-13 09:50:17 -04:00
Derrell Lipman
7c39e450fc Fix broken smb_thread_once function (again)
- It would help if smb_thread_once did, eventually, set the variable that
  prevents the init function from being run again. Sigh. It must be getting
  late.

Derrell
2009-05-12 21:32:33 -04:00
Derrell Lipman
8a60c26c7c Fix broken smb_thread_once function
- We can't set *ponce=true before running the function because although other
  threads wouldn't re-run the initialization function, they could potentially
  proceed beyond the initialization point while the first thread was still
  running the initialization function. If a second thread gets to an
  SMB_THREAD_ONCE() call while one with the same ponce is running, we need to
  ensure that it enters smb_thread_once() to await the mutex and then recheck
  whether *ponce is set or not.  My original comment about other "once"
  functions possibly being called from within this "once" function is
  irrelevant since those other ones would have their own unique ponce.

Derrell
2009-05-12 21:24:34 -04:00
Jeremy Allison
6bc1ce996d Fix definition of smb_thread_once - must return int not void as
it's used in a ? : comparison macro.
Jeremy.
2009-05-11 22:33:32 -07:00
Jeremy Allison
d0865aeb5d Ensure documentation matches the tdb_util function usage.
Jeremy.
2009-05-11 17:29:16 -07:00
Derrell Lipman
915518c0db Use bool instead of int for a boolean variable 2009-05-10 23:04:00 -04:00
Derrell Lipman
9a93dc092c Optimize smb_thread_once usage by not calling it if known already called
- The macro SMB_THREAD_ONCE now tests whether the "once" variable is already
  set, and if so avoids calling smb_thread_once().

Derrell
2009-05-10 22:58:12 -04:00
Derrell Lipman
404327ad41 Panic upon mutex lock or unlock failure
- It's a serious error if we can't lock or unlock a mutex in
  smb_thread_once(). Panic instead of just displaying a DEBUG message.

Derrell
2009-05-10 22:45:12 -04:00
Derrell Lipman
418a2eeae8 Don't require external use of internal enum smb_thread_lock_type
- Internally, when locking or unlocking a mutex, we'll pass one of the
  values of enum smb_thread_lock_type. That enum is not available to users
  providing a thread implementation. Externally, we'll document the integer
  values which will be passed to their lock_mutex function, but not require
  them to access our internal header file.

Derrell
2009-05-10 22:45:12 -04:00
Derrell Lipman
d3434477e6 Replace external thread "once" with an internal implementation
Jeremy, please check...

- I'm in the process of providing an interface in libsmbclient to the
  recently-added threading capabilities. In the process, I discovered that
  different thread implementations have varying types for the variable passed
  to the thread_impl_once() function. pthreads, for example, uses type
  pthread_once_t. Since Samba needs to internally declare these variables, it
  would need to know the exact type required by each thread implementation's
  function. After considering multiple methods of obtaining an appropriately
  sized variable, I decided that for the basic "once" functionality required
  by Samba, it would be much simpler to just implement our own "once"
  functionality. We don't require cancellation points et all. This commit adds
  an smb_thread_once() function that is implemented using an internal
  mutex. The mutex itself uses the implementation's create_mutex
  function. This eliminates the need for the user to provide a smb_thread_once
  function pointer and the entire issue of that function's first parameter.

Derrell
2009-05-10 22:45:12 -04:00
Stefan Metzmacher
6f7cd213dd tevent: fix typo async_req_done() => tevent_req_done()
metze
2009-05-07 08:09:56 +02:00
Jelmer Vernooij
730c91aaaa Avoid --nonet when building manpages; xsltproc will already prefer local
stylesheets if they are installed.
2009-05-06 17:48:01 +02:00
Simo Sorce
d52172654c Update tdb and talloc web pages 2009-05-05 19:04:39 -04:00
Simo Sorce
b58abb262c Add release scripts for talloc and tdb 2009-05-05 09:51:00 -04:00
Volker Lendecke
2467ae1b6a Clean up after Tridge's util_strlist changes 2009-05-03 13:46:44 +02:00
Volker Lendecke
6ca4d727c4 Attempt to the build on NetBSD5 and a few others 2009-05-01 23:26:22 +02:00
Stefan Metzmacher
6ac61e6707 tsocket: add tstream_readv_pdu_queue_send/recv()
metze
2009-05-01 17:42:01 +02:00
Stefan Metzmacher
eb723c2061 tsocket: add tstream_writev_queue_send/recv()
metze
2009-05-01 17:42:00 +02:00
Stefan Metzmacher
a0830f4cb9 tsocket: add tstream_readv_pdu_send/recv()
metze
2009-05-01 17:41:56 +02:00
Stefan Metzmacher
ee6d796c19 tsocket: add tstream implementation for bsd sockets (inet and unix)
metze
2009-05-01 17:41:55 +02:00
Stefan Metzmacher
8a090c4b8b tsocket: add tstream_context infrastructure similar to tdgram_context
metze
2009-05-01 17:41:53 +02:00
Stefan Metzmacher
182a4b30de tsocket: rename tdgram_unix_dgram_socket() => tdgram_unix_socket()
metze
2009-05-01 17:41:38 +02:00
Stefan Metzmacher
b46599590f tsocket: move tsocket_simple_int_recv() to tsocket.c
metze
2009-05-01 17:38:27 +02:00
Stefan Metzmacher
0db3b944bd tsocket: move tsocket_sendto_queue_send/recv() to tsocket_helpers.c
metze
2009-05-01 17:38:26 +02:00
Stefan Metzmacher
b4c5387e9f tsocket: tdgram move input checks to the common code as there're needed for all backends
We need to make sure that we free the sendto and recvfrom requests before
the tdgram_context

metze
2009-05-01 17:38:25 +02:00
Stefan Metzmacher
cc75ff1a37 tsocket: for unix domain sockets we need to use sizeof(struct sockaddr_un)
sizeof(struct sockaddr_storage) generates EINVAL.

metze
2009-05-01 17:38:24 +02:00
Stefan Metzmacher
66a2cd36c6 tsocket: return EINVAL when tdgram_sendto_send() is used with len == 0
metze
2009-05-01 17:38:23 +02:00
Stefan Metzmacher
997eb9eb43 tsocket: fix dependecies
metze
2009-05-01 17:38:22 +02:00
Stefan Metzmacher
9dbb535aa5 tsocket: remove tsocket_context related stuff
It will be replaced by tdgram_context and tstream_context.

metze
2009-05-01 17:38:21 +02:00
Volker Lendecke
46bbdbd8c7 Fix a missing prototype warning 2009-04-28 15:34:22 +02:00
Michael Adam
664da577f9 pm_process():raise level of debug message
Michael
2009-04-28 12:20:38 +02:00
Jelmer Vernooij
3cf48ee05a Fix push_codepoint function without iconv_convenience. 2009-04-23 17:50:18 +02:00
Jelmer Vernooij
80420745ff Add a new non-convenience version of push_codepoint. 2009-04-23 17:50:18 +02:00
Simo Sorce
b029e0edcf Prevent reallocs of the talloc pool itself 2009-04-22 09:58:06 -04:00
Brad Hards
703d589770 Avoid using deprecated form of AC_CHECK_TYPE.
libreplace makes use of an older form of AC_CHECK_TYPE which basically
provides a fallback definition for the type if it isn't available.
http://www.gnu.org/software/hello/manual/autoconf/Obsolete-Macros.html#Obsolete-Macros
shows why this isn't a good idea (its not so important, except for pointer types).
This patch partly addresses the issue.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-04-22 10:36:47 +02:00
Jelmer Vernooij
bb0f430064 Error out at runtime when seteuid/setresuid or setegid/setresgid are not
available. This means it's possible to compile libreplace when these
functions are not available and use it, as long as this particular
function is not used.
2009-04-20 16:25:17 +02:00
Jelmer Vernooij
20e1ba1c09 Only define waitpid replacement if wait4 is available. (It isn't on
Windows.)
2009-04-20 16:25:16 +02:00