aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Isom <coder@kyleisom.net>2012-05-22 01:02:57 +0300
committerKyle Isom <coder@kyleisom.net>2012-05-22 01:02:57 +0300
commit4955e57d4079e3468b8ec37ae861a0d4cda5f4d5 (patch)
treebbc0eb12bd6e6e5d76f2dd64c1137990e35d31d0
parenta0bac7d66bdf1f42409045a95b9224223004452d (diff)
downloadsrvwd-4955e57d4079e3468b8ec37ae861a0d4cda5f4d5.tar.gz
srvwd-4955e57d4079e3468b8ec37ae861a0d4cda5f4d5.tar.bz2
srvwd-4955e57d4079e3468b8ec37ae861a0d4cda5f4d5.zip
Makefile cleanup; code cleanup
Makefile: clean now removes *.plist, which are generated on clang static analysis passes. server.c: in sigchld handler, rename signal passed into function to be consistent with other signal handlers.
-rw-r--r--Makefile.in4
-rw-r--r--server.c10
2 files changed, 4 insertions, 10 deletions
diff --git a/Makefile.in b/Makefile.in
index f4104fe..9259d97 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -18,8 +18,8 @@ CFLAGS += $OS_CFLAGS
all: $(TARGET)
clean:
- -rm -f .*.* *.core *.o *.html tags $(TARGET)
- -rm -rf security
+ -rm -f .?*.* *.core *.o *.html tags $(TARGET)
+ -rm -rf security *.plist
-rm -rf $(TARGET)-$(VERSION)
-rm -f $(TARGET)-$(VERSION).tgz
diff --git a/server.c b/server.c
index f6b6010..99e66e0 100644
--- a/server.c
+++ b/server.c
@@ -50,9 +50,9 @@ static void sigint_handler(int);
* reap child processes
*/
void
-sigchld_handler(int s)
+sigchld_handler(int sig)
{
- s = 0; /* we don't need s, but all sig handlers need s */
+ sig = 0; /* we don't need s, but all sig handlers need s */
while (waitpid(-1, NULL, WNOHANG) > 0) ;
}
@@ -245,12 +245,6 @@ run_server(int sockfd, int listeners)
break;
while (1) {
- /*
- * after the return from the signal handler, control can pass to the
- * statement after the accept() call. clearing clientfd prevents us
- * from having an invalid state there
- */
- clientfd = 0;
clientfd = accept(sockfd, (struct sockaddr *)&client_addr,
(socklen_t *)&sin_size);
if (clientfd > 0 && !fork()) {