Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Oct 2010 21:43:06 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213429 - head/sbin/hastd
Message-ID:  <201010042143.o94Lh6HS028371@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Mon Oct  4 21:43:06 2010
New Revision: 213429
URL: http://svn.freebsd.org/changeset/base/213429

Log:
  hook_check() is now only used to report about long-running hooks, so the
  argument is redundant, remove it.
  
  MFC after:	3 days

Modified:
  head/sbin/hastd/hastd.c
  head/sbin/hastd/hooks.c
  head/sbin/hastd/hooks.h

Modified: head/sbin/hastd/hastd.c
==============================================================================
--- head/sbin/hastd/hastd.c	Mon Oct  4 21:41:18 2010	(r213428)
+++ head/sbin/hastd/hastd.c	Mon Oct  4 21:43:06 2010	(r213429)
@@ -659,7 +659,7 @@ main_loop(void)
 		assert(maxfd + 1 <= (int)FD_SETSIZE);
 		ret = select(maxfd + 1, &rfds, NULL, NULL, &seltimeout);
 		if (ret == 0)
-			hook_check(false);
+			hook_check();
 		else if (ret == -1) {
 			if (errno == EINTR)
 				continue;

Modified: head/sbin/hastd/hooks.c
==============================================================================
--- head/sbin/hastd/hooks.c	Mon Oct  4 21:41:18 2010	(r213428)
+++ head/sbin/hastd/hooks.c	Mon Oct  4 21:43:06 2010	(r213429)
@@ -293,24 +293,14 @@ hook_check_one(pid_t pid, int status)
 }
 
 void
-hook_check(bool sigchld)
+hook_check(void)
 {
 	struct hookproc *hp, *hp2;
-	int status;
 	time_t now;
-	pid_t pid;
 
 	assert(hooks_initialized);
 
 	/*
-	 * If SIGCHLD was received, garbage collect finished processes.
-	 */
-	if (sigchld) {
-		while ((pid = wait3(&status, WNOHANG, NULL)) > 0)
-			hook_check_one(pid, status);
-	}
-
-	/*
 	 * Report about processes that are running for a long time.
 	 */
 	now = time(NULL);

Modified: head/sbin/hastd/hooks.h
==============================================================================
--- head/sbin/hastd/hooks.h	Mon Oct  4 21:41:18 2010	(r213428)
+++ head/sbin/hastd/hooks.h	Mon Oct  4 21:43:06 2010	(r213429)
@@ -41,7 +41,7 @@
 void hook_init(void);
 void hook_fini(void);
 void hook_check_one(pid_t pid, int status);
-void hook_check(bool sigchld);
+void hook_check(void);
 void hook_exec(const char *path, ...);
 void hook_execv(const char *path, va_list ap);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010042143.o94Lh6HS028371>