Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
orbea -
OpenLDAP
Commits
352e8eba
Commit
352e8eba
authored
Jul 02, 1999
by
Kurt Zeilenga
Browse files
Reap back-shell children processes using SIGCHLD handler.
parent
a6883d27
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
352e8eba
...
...
@@ -3,6 +3,7 @@ OpenLDAP Change Log
Changes included in OpenLDAP 1.2 Release Engineering
CVS Tag: OPENLDAP_REL_ENG_1_2
Added the MDBM to the ldbm backends (memory mapped dbm)
Fixed slapd to reap back-shell children processes
Updated README to require BerkeleyDB 2.7.5
Fixed incorrect schema check when objectclass is missing (ITS#204)
Build environment
...
...
include/ac/signal.h
View file @
352e8eba
...
...
@@ -14,6 +14,7 @@
#include
<signal.h>
#undef SIGNAL
#ifdef HAVE_SIGSET
#define SIGNAL sigset
#else
...
...
@@ -52,4 +53,12 @@
# endif
#endif
#ifndef LDAP_SIGCHLD
#ifdef SIGCHLD
#define LDAP_SIGCHLD SIGCHLD
#elif SIGCLD
#define LDAP_SIGCHLD SIGCLD
#endif
#endif
#endif
/* _AC_SIGNAL_H */
servers/slapd/main.c
View file @
352e8eba
...
...
@@ -2,6 +2,7 @@
#include
<stdio.h>
#include
<ac/errno.h>
#include
<ac/signal.h>
#include
<ac/socket.h>
#include
<ac/string.h>
...
...
@@ -12,6 +13,10 @@
#include
"slap.h"
#include
"lutil.h"
/* Get lutil_detach() */
#ifdef LDAP_SIGCHLD
static
void
wait4child
(
int
sig
);
#endif
/*
* when more than one slapd is running on one machine, each one might have
* it's own LOCAL for syslogging and must have its own pid/args files
...
...
@@ -197,6 +202,9 @@ main( int argc, char **argv )
(
void
)
SIGNAL
(
SIGTERM
,
slap_set_shutdown
);
(
void
)
SIGNAL
(
SIGINT
,
slap_set_shutdown
);
(
void
)
SIGNAL
(
SIGHUP
,
slap_set_shutdown
);
#ifdef LDAP_SIGCHLD
(
void
)
SIGNAL
(
LDAP_SIGCHLD
,
wait4child
);
#endif
time
(
&
starttime
);
...
...
@@ -295,6 +303,36 @@ main( int argc, char **argv )
}
#ifdef LDAP_SIGCHLD
/*
* Catch and discard terminated child processes, to avoid zombies.
*/
static
void
wait4child
(
int
sig
)
{
int
save_errno
=
errno
;
#ifdef WNOHANG
errno
=
0
;
#ifdef HAVE_WAITPID
while
(
waitpid
(
(
pid_t
)
-
1
,
NULL
,
WNOHANG
)
>=
0
||
errno
==
EINTR
)
;
/* NULL */
#else
while
(
wait3
(
NULL
,
WNOHANG
,
NULL
)
>=
0
||
errno
==
EINTR
)
;
/* NULL */
#endif
#else
(
void
)
wait
(
NULL
);
#endif
(
void
)
SIGNAL
(
sig
,
wait4child
);
errno
=
save_errno
;
}
#endif
/* SIGCHLD || SIGCLD */
#ifdef LOG_LOCAL4
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment