[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    r4312 - branches/2.0/varnish-cache/bin/varnishd
From:       tfheen () projects ! linpro ! no (tfheen at projects ! linpro ! no)
Date:       2009-10-08 15:01:02
Message-ID: 20091008150102.F0D181F736F () projects ! linpro ! no
[Download RAW message or body]

Author: tfheen
Date: 2009-10-08 17:01:02 +0200 (Thu, 08 Oct 2009)
New Revision: 4312

Modified:
   branches/2.0/varnish-cache/bin/varnishd/mgt_child.c
   branches/2.0/varnish-cache/bin/varnishd/varnishd.c
Log:
Merge r4210: Factor getdtablesize() out of close loop.



Modified: branches/2.0/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/mgt_child.c	2009-10-08 14:55:41 UTC (rev 4311)
+++ branches/2.0/varnish-cache/bin/varnishd/mgt_child.c	2009-10-08 15:01:02 UTC (rev 4312)
@@ -236,7 +236,7 @@
 	unsigned u;
 	char *p;
 	struct vev *e;
-	int i, cp[2];
+	int i, j, cp[2];
 
 	if (child_state != CH_STOPPED && child_state != CH_DIED)
 		return;
@@ -304,7 +304,8 @@
 		/* Close anything we shouldn't know about */
 		closelog();
 		printf("Closed fds:");
-		for (i = STDERR_FILENO + 1; i < getdtablesize(); i++) {
+		j = getdtablesize();
+		for (i = STDERR_FILENO + 1; i < j; i++) {
 			if (vbit_test(fd_map, i))
 				continue;
 			if (close(i) == 0)

Modified: branches/2.0/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/varnishd.c	2009-10-08 14:55:41 UTC (rev 4311)
+++ branches/2.0/varnish-cache/bin/varnishd/varnishd.c	2009-10-08 15:01:02 UTC (rev 4312)
@@ -339,7 +339,8 @@
 	pipes[1][1] = 1;
 
 	/* close the rest */
-	for (i = 5; i < getdtablesize(); i++)
+	j = getdtablesize();
+	for (i = 5; i < j; i++)
 		(void)close(i);
 
 	pfd[0].fd = pipes[0][0];


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic