Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
9c323b79
...
9c323b7980a2cdf759c043c2bfc224f72db46974
authored
1999-10-06 05:20:28 +0000
by
Sean 'Shaleh' Perry
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added sigchld handling
1 parent
fdc6161f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
9 deletions
ChangeLog
pop3d/Makefile.am
pop3d/extra.c
pop3d/pop3d.c
pop3d/pop3d.h
pop3d/signal.c
ChangeLog
View file @
9c323b7
Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 5 Oct 1999 17:46:31 -0700
* added pop3d/signal.c -- contains pop3_sigchld() currently
Sean 'Shaleh' Perry <shaleh@debian.org> Mon, 4 Oct 1999 17:57:17 -0700
* initial fork() rewrite, not even compiled it yet
...
...
pop3d/Makefile.am
View file @
9c323b7
...
...
@@ -5,11 +5,11 @@ sbin_PROGRAMS = pop3d
pop3d_DEPENDENDENCIES
=
../libmailbox/libmailbox.la ../libsrc/libgetopt.la
\
../libsrc/libmd5.la
pop3d_SOURCES
=
apop.c auth.c capa.c dele.c extra.c pop3d.c pop3d.h
\
list.c noop.c quit.c retr.c rset.c stat.c top.c uidl.c user.c
list.c noop.c quit.c retr.c rset.c stat.c top.c uidl.c user.c
signal.c
#if USE_LIBPAM
#pop3d_LDADD = ../libmailbox/libmailbox.la -lpam -ldl
#else
#pop3d_LDADD = ../libmailbox/libmailbox.la
#endif
pop3d_LADADD
=
../libmailbox/libmailbox.la
$(AUTHLIBS)
\ No newline at end of file
pop3d_LADADD
=
../libmailbox/libmailbox.la
$(AUTHLIBS)
...
...
pop3d/extra.c
View file @
9c323b7
...
...
@@ -145,10 +145,7 @@ pop3_usage (char *argv0)
void
pop3_signal
(
int
signal
)
{
if
(
signal
==
SIGCHLD
)
--
children
;
else
pop3_abquit
(
ERR_SIGNAL
);
pop3_abquit
(
ERR_SIGNAL
);
}
/* Gets a line of input from the client */
...
...
pop3d/pop3d.c
View file @
9c323b7
...
...
@@ -18,8 +18,9 @@
#include "pop3d.h"
typedef
struct
sockaddr_in
SA
;
/* count of number of child processes */
unsigned
int
children
=
0
;
#define strorepid(foo)
/* will add more code here later */
static
struct
option
long_options
[]
=
{
...
...
@@ -165,7 +166,7 @@ pop3_daemon_init (void)
for
(
i
=
0
;
i
<
MAXFD
;
++
i
)
close
(
i
);
signal
(
SIGCHLD
,
pop3_sig
nal
);
/* for forking */
signal
(
SIGCHLD
,
pop3_sig
chld
);
}
/* The main part of the daemon. This function reads input from the client and
...
...
@@ -336,11 +337,11 @@ pop3_daemon (unsigned int maxchildren)
else
if
(
pid
==
0
)
/* child */
{
close
(
listenfd
);
/* syslog(); FIXME log the info on the connectiing client */
pop3_mainloop
(
connfd
,
connfd
);
}
else
{
storepid
(
pid
);
++
children
;
}
...
...
pop3d/pop3d.h
View file @
9c323b7
...
...
@@ -168,6 +168,7 @@ int pop3_mainloop (int infile, int outfile);
int
pop3_daemon
(
int
maxchildren
);
void
pop3_usage
(
char
*
argv0
);
void
pop3_signal
(
int
signal
);
void
pop3_sigchld
(
int
signal
);
void
pop3_daemon_init
(
void
);
#ifdef _USE_APOP
char
*
pop3_apopuser
(
const
char
*
user
);
...
...
pop3d/signal.c
0 → 100644
View file @
9c323b7
/* GNU copyright notice */
#include "pop3d.h"
void
pop3_sigchld
(
int
signal
)
{
pid_t
pid
;
int
stat
;
while
(
(
pid
=
waitpid
(
-
1
,
&
stat
,
WNOHANG
))
>
0
)
--
children
;
return
;
}
Please
register
or
sign in
to post a comment