summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tevent')
-rwxr-xr-xlib/tevent/abi_checks.sh (renamed from lib/tevent/script/abi_checks_gcc.sh)0
-rwxr-xr-xlib/tevent/config.guess4
-rwxr-xr-xlib/tevent/config.sub2
-rwxr-xr-xlib/tevent/release-script.sh48
-rwxr-xr-xlib/tevent/script/abi_checks.sh91
-rwxr-xr-xlib/tevent/script/mksigs.pl183
-rw-r--r--lib/tevent/script/mksyms.awk76
-rwxr-xr-xlib/tevent/script/mksyms.sh45
-rw-r--r--lib/tevent/tevent.c2
-rw-r--r--lib/tevent/tevent.exports2
-rw-r--r--lib/tevent/tevent.mk12
-rw-r--r--lib/tevent/tevent.signatures2
-rw-r--r--lib/tevent/tevent_internal.h4
-rw-r--r--lib/tevent/tevent_signal.c76
14 files changed, 43 insertions, 504 deletions
diff --git a/lib/tevent/script/abi_checks_gcc.sh b/lib/tevent/abi_checks.sh
index 95182097d5..95182097d5 100755
--- a/lib/tevent/script/abi_checks_gcc.sh
+++ b/lib/tevent/abi_checks.sh
diff --git a/lib/tevent/config.guess b/lib/tevent/config.guess
index da83314608..4af85584ae 100755
--- a/lib/tevent/config.guess
+++ b/lib/tevent/config.guess
@@ -808,7 +808,7 @@ EOF
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
@@ -984,7 +984,7 @@ EOF
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
diff --git a/lib/tevent/config.sub b/lib/tevent/config.sub
index a39437d015..80a785297e 100755
--- a/lib/tevent/config.sub
+++ b/lib/tevent/config.sub
@@ -1454,7 +1454,7 @@ case $basic_machine in
os=-aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
diff --git a/lib/tevent/release-script.sh b/lib/tevent/release-script.sh
deleted file mode 100755
index 077f562967..0000000000
--- a/lib/tevent/release-script.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-
-if [ "$1" = "" ]; then
- echo "Please provide version string, eg: 1.2.0"
- exit 1
-fi
-
-if [ ! -d "lib/tevent" ]; then
- echo "Run this script from the samba base directory."
- exit 1
-fi
-
-git clean -f -x -d lib/tevent
-git clean -f -x -d lib/replace
-
-curbranch=`git-branch |grep "^*" | tr -d "* "`
-
-version=$1
-strver=`echo ${version} | tr "." "-"`
-
-# Checkout the release tag
-git branch -f tevent-release-script-${strver} tevent-${strver}
-if [ ! "$?" = "0" ]; then
- echo "Unable to checkout tevent-${strver} release"
- exit 1
-fi
-
-git checkout tevent-release-script-${strver}
-
-# Test configure agrees with us
-confver=`grep "^AC_INIT" lib/tevent/configure.ac | tr -d "AC_INIT(tevent, " | tr -d ")"`
-if [ ! "$confver" = "$version" ]; then
- echo "Wrong version, requested release for ${version}, found ${confver}"
- exit 1
-fi
-
-# Now build tarball
-cp -a lib/tevent tevent-${version}
-cp -a lib/replace tevent-${version}/libreplace
-pushd tevent-${version}
-./autogen.sh
-popd
-tar cvzf tevent-${version}.tar.gz tevent-${version}
-rm -fr tevent-${version}
-
-#Clean up
-git checkout $curbranch
-git branch -d tevent-release-script-${strver}
diff --git a/lib/tevent/script/abi_checks.sh b/lib/tevent/script/abi_checks.sh
deleted file mode 100755
index c34a659d73..0000000000
--- a/lib/tevent/script/abi_checks.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-#
-# abi_checks.sh - check for possible abi changes
-#
-# Copyright (C) 2009 Micheal Adam <obnox@samba.org>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 3 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, see <http://www.gnu.org/licenses/>.
-#
-
-#
-# USAGE: abi_checks.sh LIBNAME header1 [header2 ...]
-#
-# This script creates symbol and signature lists from the provided header
-# files with the aid of the mksyms.sh and mksigs.pl scripts (saved as
-# $LIBNAME.exports.check and $LIBNAME.sigatures.check). It then compares
-# the resulting files with the files $LIBNAME.exports and $LIBNME.signatures
-# which it expects to find in the current directory.
-#
-
-LANG=C; export LANG
-LC_ALL=C; export LC_ALL
-LC_COLLATE=C; export LC_COLLATE
-
-script=$0
-dir_name=$(dirname ${script})
-
-if test x"$1" = "x" ; then
- echo "USAGE: ${script} libname header [header ...]"
- exit 1
-fi
-
-libname="$1"
-shift
-
-if test x"$1" = "x" ; then
- echo "USAGE: ${script} libname header [header ...]"
- exit 1
-fi
-
-headers="$*"
-
-exports_file=${libname}.exports
-exports_file_check=${exports_file}.check
-signatures_file=${libname}.signatures
-signatures_file_check=${signatures_file}.check
-
-
-${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev/null
-
-cat ${headers} | ${dir_name}/mksigs.pl > ${signatures_file_check} 2> /dev/null
-
-normalize_exports_file() {
- filename=$1
- cat ${filename} \
- | sed -e 's/^[ \t]*//g' \
- | sed -e 's/^$//g' \
- | sed -e 's/^#.*$//g' \
- | sort | uniq > ${filename}.sort
-}
-
-normalize_exports_file ${exports_file}
-normalize_exports_file ${exports_file_check}
-
-normalize_exports_file ${signatures_file}
-normalize_exports_file ${signatures_file_check}
-
-diff -u ${exports_file}.sort ${exports_file_check}.sort
-if test "x$?" != "x0" ; then
- echo "WARNING: possible ABI change detected in exports!"
-else
- echo "exports check: OK"
-fi
-
-diff -u ${signatures_file}.sort ${signatures_file_check}.sort
-if test "x$?" != "x0" ; then
- echo "WARNING: possible ABI change detected in signatures!"
-else
- echo "signatures check: OK"
-fi
diff --git a/lib/tevent/script/mksigs.pl b/lib/tevent/script/mksigs.pl
deleted file mode 100755
index 755cd79603..0000000000
--- a/lib/tevent/script/mksigs.pl
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/perl
-
-# mksigs.pl - extract signatures from C headers
-#
-# Copyright (C) Michael Adam 2009
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 3 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, see <http://www.gnu.org/licenses/>.
-
-# USAGE: cat $header_files | mksigs.pl > $signature_file
-#
-# The header files to parse are read from stdin.
-# The output is in a form as produced by gcc with the -aux-info switch
-# and printed to stdout.
-
-use strict;
-use warnings;
-
-my $in_comment = 0;
-my $extern_C_block = 0;
-
-while (my $LINE = <>) {
- # find end of started multi-line-comment
- if ($in_comment) {
- if ($LINE =~ /^.*?\*\/(.*)$/) {
- $LINE = $1;
- $in_comment = 0;
- } else {
- # whole line within comment
- next;
- }
- }
-
- # strip C++-style comments
- $LINE =~ s/^(.*?)\/\/.*$/$1/;
-
- # strip in-line-comments:
- while ($LINE =~ /\/\*.*?\*\//) {
- $LINE =~ s/\/\*.*?\*\///;
- }
-
- # find starts of multi-line-comments
- if ($LINE =~ /^(.*)\/\*/) {
- $in_comment = 1;
- $LINE = $1;
- }
-
- # skip empty lines
- next if $LINE =~ /^\s*$/;
-
- # remove leading spaces
- $LINE =~ s/^\s*(.*)$/$1/;
-
- # concatenate lines split with "\" (usually macro defines)
- while ($LINE =~ /^(.*?)\s+\\$/) {
- my $LINE2 = <>;
- $LINE = $1;
- $LINE2 =~ s/^\s*(.*)$/$1/;
- $LINE .= " " . $LINE2;
- }
-
- # remove all preprocessor directives
- next if ($LINE =~ /^#/);
-
- if ($LINE =~ /^extern\s+"C"\s+\{/) {
- $extern_C_block = 1;
- next;
- }
-
- if (($LINE =~ /^[^\{]*\}/) and $extern_C_block) {
- $extern_C_block = 0;
- next;
- }
-
- $LINE =~ s/^extern\s//;
-
- # concatenate braces stretched over multiple lines
- # (from structs or enums)
- my $REST = $LINE;
- my $braces = 0;
- while (($REST =~ /[\{\}]/) or ($braces)) {
- while ($REST =~ /[\{\}]/) {
- # collect opening
- while ($REST =~ /^[^\{\}]*\{(.*)$/) {
- $braces++;
- $REST = $1;
- }
-
- # collect closing
- while ($REST =~ /^[^\{\}]*\}(.*)$/) {
- $braces--;
- $REST = $1;
- }
- }
-
- # concatenate if not balanced
- if ($braces) {
- if (my $LINE2 = <>) {
- $LINE2 =~ s/^\s*(.*)$/$1/;
- chomp($LINE);
- $LINE .= " " . $LINE2;
- chomp $REST;
- $REST .= " " . $LINE2;
- } else {
- print "ERROR: unbalanced braces ($braces)\n";
- last;
- }
- }
- }
-
- # concetenate function prototypes that stretch over multiple lines
- $REST = $LINE;
- my $parenthesis = 0;
- while (($REST =~ /[\(\)]/) or ($parenthesis)) {
- while ($REST =~ /[\(\)]/) {
- # collect opening
- while ($REST =~ /^[^\(\)]*\((.*)$/) {
- $parenthesis++;
- $REST = $1;
- }
-
- # collect closing
- while ($REST =~ /^[^\(\)]*\)(.*)$/) {
- $parenthesis--;
- $REST = $1;
- }
- }
-
- # concatenate if not balanced
- if ($parenthesis) {
- if (my $LINE2 = <>) {
- $LINE2 =~ s/^\s*(.*)$/$1/;
- chomp($LINE);
- $LINE .= " " . $LINE2;
- chomp($REST);
- $REST .= " " . $LINE2;
- } else {
- print "ERROR: unbalanced parantheses ($parenthesis)\n";
- last;
- }
- }
- }
-
- next if ($LINE =~ /^typedef\s/);
- next if ($LINE =~ /^enum\s+[^\{\(]+\s+\{/);
- next if ($LINE =~ /^struct\s+[^\{\(]+\s+\{.*\}\s*;/);
- next if ($LINE =~ /^struct\s+[a-zA-Z0-9_]+\s*;/);
-
- # remove trailing spaces
- $LINE =~ s/(.*?)\s*$/$1/;
-
- $LINE =~ s/^(.*\))\s+PRINTF_ATTRIBUTE\([^\)]*\)(\s*[;,])/$1$2/;
- $LINE =~ s/^(.*\))\s*[a-zA-Z0-9_]+\s*;$/$1;/;
-
- # remove parameter names - slightly too coarse probably
- $LINE =~ s/([\s\(]\*?)[_0-9a-zA-Z]+\s*([,\)])/$1$2/g;
-
- # remedy (void) from last line
- $LINE =~ s/\(\)/(void)/g;
-
- # normalize spaces
- $LINE =~ s/\s*\)\s*/)/g;
- $LINE =~ s/\s*\(\s*/ (/g;
- $LINE =~ s/\s*,\s*/, /g;
-
- # normalize unsigned
- $LINE =~ s/([\s,\(])unsigned([,\)])/$1unsigned int$2/g;
-
- # normalize bool
- $LINE =~ s/(\b)bool(\b)/_Bool/g;
-
- print $LINE . "\n";
-}
diff --git a/lib/tevent/script/mksyms.awk b/lib/tevent/script/mksyms.awk
deleted file mode 100644
index 94a405ca68..0000000000
--- a/lib/tevent/script/mksyms.awk
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# mksyms.awk
-#
-# Extract symbols to export from C-header files.
-# output in version-script format for linking shared libraries.
-#
-# Copyright (C) 2008 Michael Adam <obnox@samba.org>
-#
-BEGIN {
- inheader=0;
- current_file="";
- print "#"
- print "# This file is automatically generated with \"make symbols\". DO NOT EDIT "
- print "#"
- print "{"
- print "\tglobal:"
-}
-
-END {
- print""
- print "\tlocal: *;"
- print "};"
-}
-
-{
- if (FILENAME!=current_file) {
- print "\t\t# The following definitions come from",FILENAME
- current_file=FILENAME
- }
- if (inheader) {
- if (match($0,"[)][^()]*[;][ \t]*$")) {
- inheader = 0;
- }
- next;
- }
-}
-
-/^static/ || /^[ \t]*typedef/ || !/^[a-zA-Z\_]/ {
- next;
-}
-
-/^extern[ \t]+[^()]+[;][ \t]*$/ {
- gsub(/[^ \t]+[ \t]+/, "");
- sub(/[;][ \t]*$/, "");
- printf "\t\t%s;\n", $0;
- next;
-}
-
-# look for function headers:
-{
- gotstart = 0;
- if ($0 ~ /^[A-Za-z_][A-Za-z0-9_]+/) {
- gotstart = 1;
- }
- if(!gotstart) {
- next;
- }
-}
-
-/[_A-Za-z0-9]+[ \t]*[(].*[)][^()]*;[ \t]*$/ {
- sub(/[(].*$/, "");
- gsub(/[^ \t]+[ \t]+/, "");
- gsub(/^[*]+/, "");
- printf "\t\t%s;\n",$0;
- next;
-}
-
-/[_A-Za-z0-9]+[ \t]*[(]/ {
- inheader=1;
- sub(/[(].*$/, "");
- gsub(/[^ \t]+[ \t]+/, "");
- gsub(/^[*]/, "");
- printf "\t\t%s;\n",$0;
- next;
-}
-
diff --git a/lib/tevent/script/mksyms.sh b/lib/tevent/script/mksyms.sh
deleted file mode 100755
index 7fb4031e2b..0000000000
--- a/lib/tevent/script/mksyms.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-
-#
-# mksyms.sh
-#
-# Extract symbols to export from C-header files.
-# output in version-script format for linking shared libraries.
-#
-# This is the shell wrapper for the mksyms.awk core script.
-#
-# Copyright (C) 2008 Michael Adam <obnox@samba.org>
-#
-
-LANG=C; export LANG
-LC_ALL=C; export LC_ALL
-LC_COLLATE=C; export LC_COLLATE
-
-if [ $# -lt 2 ]
-then
- echo "Usage: $0 awk output_file header_files"
- exit 1
-fi
-
-awk="$1"
-shift
-
-symsfile="$1"
-shift
-symsfile_tmp="$symsfile.$$.tmp~"
-
-proto_src="`echo $@ | tr ' ' '\n' | sort | uniq `"
-
-echo creating $symsfile
-
-mkdir -p `dirname $symsfile`
-
-${awk} -f `dirname $0`/mksyms.awk $proto_src > $symsfile_tmp
-
-if cmp -s $symsfile $symsfile_tmp 2>/dev/null
-then
- echo "$symsfile unchanged"
- rm $symsfile_tmp
-else
- mv $symsfile_tmp $symsfile
-fi
diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c
index 56d0da3927..76a6ac1c97 100644
--- a/lib/tevent/tevent.c
+++ b/lib/tevent/tevent.c
@@ -429,7 +429,7 @@ void tevent_loop_set_nesting_hook(struct tevent_context *ev,
tevent_nesting_hook hook,
void *private_data)
{
- if (ev->nesting.hook_fn &&
+ if (ev->nesting.hook_fn &&
(ev->nesting.hook_fn != hook ||
ev->nesting.hook_private != private_data)) {
/* the way the nesting hook code is currently written
diff --git a/lib/tevent/tevent.exports b/lib/tevent/tevent.exports
index 01d547ad85..b1554dff4e 100644
--- a/lib/tevent/tevent.exports
+++ b/lib/tevent/tevent.exports
@@ -55,8 +55,6 @@
tevent_timeval_zero;
tevent_wakeup_recv;
tevent_wakeup_send;
- _tevent_req_cancel;
- tevent_req_set_cancel_fn;
local: *;
};
diff --git a/lib/tevent/tevent.mk b/lib/tevent/tevent.mk
index 57bfd81222..480366e938 100644
--- a/lib/tevent/tevent.mk
+++ b/lib/tevent/tevent.mk
@@ -26,21 +26,9 @@ installheaders:: installdirs
installlibs:: installdirs
cp tevent.pc $(DESTDIR)$(libdir)/pkgconfig
cp $(TEVENT_STLIB) $(TEVENT_SOLIB) $(DESTDIR)$(libdir)
- rm -f $(DESTDIR)$(libdir)/$(TEVENT_SONAME)
- ln -s $(TEVENT_SOLIB) $(DESTDIR)$(libdir)/$(TEVENT_SONAME)
- rm -f $(DESTDIR)$(libdir)/$(TEVENT_SOBASE)
- ln -s $(TEVENT_SOLIB) $(DESTDIR)$(libdir)/$(TEVENT_SOBASE)
install:: all installdirs installheaders installlibs $(PYTHON_INSTALL_TARGET)
-abi_checks::
- @echo ABI checks:
- @./script/abi_checks.sh tevent tevent.h
-
-test:: abi_checks
-
clean::
rm -f $(TEVENT_SOBASE) $(TEVENT_SONAME) $(TEVENT_SOLIB) $(TEVENT_STLIB)
rm -f tevent.pc
- rm -f tevent.exports.sort tevent.exports.check tevent.exports.check.sort
- rm -f tevent.signatures.sort tevent.signatures.check tevent.signatures.check.sort
diff --git a/lib/tevent/tevent.signatures b/lib/tevent/tevent.signatures
index c752b9e933..75f43affb2 100644
--- a/lib/tevent/tevent.signatures
+++ b/lib/tevent/tevent.signatures
@@ -53,5 +53,3 @@ void tevent_req_set_print_fn (struct tevent_req *, tevent_req_print_fn);
void _tevent_schedule_immediate (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *);
void tevent_set_abort_fn (void (*) (const char *));
void tevent_set_default_backend (const char *);
-_Bool _tevent_req_cancel (struct tevent_req *, const char *);
-void tevent_req_set_cancel_fn (struct tevent_req *, tevent_req_cancel_fn);
diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h
index e10f52e711..aa7c34aa89 100644
--- a/lib/tevent/tevent_internal.h
+++ b/lib/tevent/tevent_internal.h
@@ -4,7 +4,7 @@
generalised event loop handling
INTERNAL STRUCTS. THERE ARE NO API GUARANTEES.
- External users should only ever have to include this header when
+ External users should only ever have to include this header when
implementing new tevent backends.
Copyright (C) Stefan Metzmacher 2005-2009
@@ -142,7 +142,7 @@ struct tevent_req {
struct tevent_immediate *trigger;
/**
- * @brief the timer event if tevent_req_set_endtime was used
+ * @brief the timer event if tevent_req_set_timeout was used
*
*/
struct tevent_timer *timer;
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c
index 0f3d83e877..ab170a66cf 100644
--- a/lib/tevent/tevent_signal.c
+++ b/lib/tevent/tevent_signal.c
@@ -30,23 +30,23 @@
#include "tevent_internal.h"
#include "tevent_util.h"
-#define TEVENT_NUM_SIGNALS 64
+#define NUM_SIGNALS 64
/* maximum number of SA_SIGINFO signals to hold in the queue.
NB. This *MUST* be a power of 2, in order for the ring buffer
wrap to work correctly. Thanks to Petr Vandrovec <petr@vandrovec.name>
for this. */
-#define TEVENT_SA_INFO_QUEUE_COUNT 64
+#define SA_INFO_QUEUE_COUNT 64
-struct tevent_sigcounter {
+struct sigcounter {
uint32_t count;
uint32_t seen;
};
-#define TEVENT_SIG_INCREMENT(s) (s).count++
-#define TEVENT_SIG_SEEN(s, n) (s).seen += (n)
-#define TEVENT_SIG_PENDING(s) ((s).seen != (s).count)
+#define SIG_INCREMENT(s) (s).count++
+#define SIG_SEEN(s, n) (s).seen += (n)
+#define SIG_PENDING(s) ((s).seen != (s).count)
struct tevent_common_signal_list {
struct tevent_common_signal_list *prev, *next;
@@ -56,22 +56,22 @@ struct tevent_common_signal_list {
/*
the poor design of signals means that this table must be static global
*/
-static struct tevent_sig_state {
- struct tevent_common_signal_list *sig_handlers[TEVENT_NUM_SIGNALS+1];
- struct sigaction *oldact[TEVENT_NUM_SIGNALS+1];
- struct tevent_sigcounter signal_count[TEVENT_NUM_SIGNALS+1];
- struct tevent_sigcounter got_signal;
+static struct sig_state {
+ struct tevent_common_signal_list *sig_handlers[NUM_SIGNALS+1];
+ struct sigaction *oldact[NUM_SIGNALS+1];
+ struct sigcounter signal_count[NUM_SIGNALS+1];
+ struct sigcounter got_signal;
#ifdef SA_SIGINFO
/* with SA_SIGINFO we get quite a lot of info per signal */
- siginfo_t *sig_info[TEVENT_NUM_SIGNALS+1];
- struct tevent_sigcounter sig_blocked[TEVENT_NUM_SIGNALS+1];
+ siginfo_t *sig_info[NUM_SIGNALS+1];
+ struct sigcounter sig_blocked[NUM_SIGNALS+1];
#endif
} *sig_state;
/*
return number of sigcounter events not processed yet
*/
-static uint32_t tevent_sig_count(struct tevent_sigcounter s)
+static uint32_t sig_count(struct sigcounter s)
{
return s.count - s.seen;
}
@@ -87,8 +87,8 @@ static void tevent_common_signal_handler(int signum)
struct tevent_context *ev = NULL;
int saved_errno = errno;
- TEVENT_SIG_INCREMENT(sig_state->signal_count[signum]);
- TEVENT_SIG_INCREMENT(sig_state->got_signal);
+ SIG_INCREMENT(sig_state->signal_count[signum]);
+ SIG_INCREMENT(sig_state->got_signal);
/* Write to each unique event context. */
for (sl = sig_state->sig_handlers[signum]; sl; sl = sl->next) {
@@ -109,24 +109,24 @@ static void tevent_common_signal_handler(int signum)
static void tevent_common_signal_handler_info(int signum, siginfo_t *info,
void *uctx)
{
- uint32_t count = tevent_sig_count(sig_state->signal_count[signum]);
- /* sig_state->signal_count[signum].seen % TEVENT_SA_INFO_QUEUE_COUNT
+ uint32_t count = sig_count(sig_state->signal_count[signum]);
+ /* sig_state->signal_count[signum].seen % SA_INFO_QUEUE_COUNT
* is the base of the unprocessed signals in the ringbuffer. */
uint32_t ofs = (sig_state->signal_count[signum].seen + count) %
- TEVENT_SA_INFO_QUEUE_COUNT;
+ SA_INFO_QUEUE_COUNT;
sig_state->sig_info[signum][ofs] = *info;
tevent_common_signal_handler(signum);
/* handle SA_SIGINFO */
- if (count+1 == TEVENT_SA_INFO_QUEUE_COUNT) {
+ if (count+1 == SA_INFO_QUEUE_COUNT) {
/* we've filled the info array - block this signal until
these ones are delivered */
sigset_t set;
sigemptyset(&set);
sigaddset(&set, signum);
sigprocmask(SIG_BLOCK, &set, NULL);
- TEVENT_SIG_INCREMENT(sig_state->sig_blocked[signum]);
+ SIG_INCREMENT(sig_state->sig_blocked[signum]);
}
}
#endif
@@ -196,7 +196,7 @@ struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,
struct tevent_common_signal_list *sl;
sigset_t set, oldset;
- if (signum >= TEVENT_NUM_SIGNALS) {
+ if (signum >= NUM_SIGNALS) {
errno = EINVAL;
return NULL;
}
@@ -204,7 +204,7 @@ struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,
/* the sig_state needs to be on a global context as it can last across
multiple event contexts */
if (sig_state == NULL) {
- sig_state = talloc_zero(talloc_autofree_context(), struct tevent_sig_state);
+ sig_state = talloc_zero(talloc_autofree_context(), struct sig_state);
if (sig_state == NULL) {
return NULL;
}
@@ -267,9 +267,7 @@ struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,
act.sa_handler = NULL;
act.sa_sigaction = tevent_common_signal_handler_info;
if (sig_state->sig_info[signum] == NULL) {
- sig_state->sig_info[signum] =
- talloc_zero_array(sig_state, siginfo_t,
- TEVENT_SA_INFO_QUEUE_COUNT);
+ sig_state->sig_info[signum] = talloc_zero_array(sig_state, siginfo_t, SA_INFO_QUEUE_COUNT);
if (sig_state->sig_info[signum] == NULL) {
talloc_free(se);
return NULL;
@@ -312,14 +310,14 @@ int tevent_common_check_signal(struct tevent_context *ev)
{
int i;
- if (!sig_state || !TEVENT_SIG_PENDING(sig_state->got_signal)) {
+ if (!sig_state || !SIG_PENDING(sig_state->got_signal)) {
return 0;
}
- for (i=0;i<TEVENT_NUM_SIGNALS+1;i++) {
+ for (i=0;i<NUM_SIGNALS+1;i++) {
struct tevent_common_signal_list *sl, *next;
- struct tevent_sigcounter counter = sig_state->signal_count[i];
- uint32_t count = tevent_sig_count(counter);
+ struct sigcounter counter = sig_state->signal_count[i];
+ uint32_t count = sig_count(counter);
#ifdef SA_SIGINFO
/* Ensure we null out any stored siginfo_t entries
* after processing for debugging purposes. */
@@ -340,11 +338,11 @@ int tevent_common_check_signal(struct tevent_context *ev)
for (j=0;j<count;j++) {
/* sig_state->signal_count[i].seen
- * % TEVENT_SA_INFO_QUEUE_COUNT is
+ * % SA_INFO_QUEUE_COUNT is
* the base position of the unprocessed
* signals in the ringbuffer. */
uint32_t ofs = (counter.seen + j)
- % TEVENT_SA_INFO_QUEUE_COUNT;
+ % SA_INFO_QUEUE_COUNT;
se->handler(ev, se, i, 1,
(void*)&sig_state->sig_info[i][ofs],
se->private_data);
@@ -366,7 +364,7 @@ int tevent_common_check_signal(struct tevent_context *ev)
uint32_t j;
for (j=0;j<count;j++) {
uint32_t ofs = (counter.seen + j)
- % TEVENT_SA_INFO_QUEUE_COUNT;
+ % SA_INFO_QUEUE_COUNT;
memset((void*)&sig_state->sig_info[i][ofs],
'\0',
sizeof(siginfo_t));
@@ -374,23 +372,23 @@ int tevent_common_check_signal(struct tevent_context *ev)
}
#endif
- TEVENT_SIG_SEEN(sig_state->signal_count[i], count);
- TEVENT_SIG_SEEN(sig_state->got_signal, count);
+ SIG_SEEN(sig_state->signal_count[i], count);
+ SIG_SEEN(sig_state->got_signal, count);
#ifdef SA_SIGINFO
- if (TEVENT_SIG_PENDING(sig_state->sig_blocked[i])) {
+ if (SIG_PENDING(sig_state->sig_blocked[i])) {
/* We'd filled the queue, unblock the
signal now the queue is empty again.
Note we MUST do this after the
- TEVENT_SIG_SEEN(sig_state->signal_count[i], count)
+ SIG_SEEN(sig_state->signal_count[i], count)
call to prevent a new signal running
out of room in the sig_state->sig_info[i][]
ring buffer. */
sigset_t set;
sigemptyset(&set);
sigaddset(&set, i);
- TEVENT_SIG_SEEN(sig_state->sig_blocked[i],
- tevent_sig_count(sig_state->sig_blocked[i]));
+ SIG_SEEN(sig_state->sig_blocked[i],
+ sig_count(sig_state->sig_blocked[i]));
sigprocmask(SIG_UNBLOCK, &set, NULL);
}
#endif