[master] 889a8e4 White-space & comment cleanup

Poul-Henning Kamp phk at varnish-cache.org
Mon Nov 21 00:39:23 CET 2011


commit 889a8e4c05d8fb9dd5e17dfbd63f825e4822798e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Nov 20 19:39:46 2011 +0000

    White-space & comment cleanup

diff --git a/bin/varnishd/common/common_vsm.c b/bin/varnishd/common/common_vsm.c
index 781b01c..a2a4fe4 100644
--- a/bin/varnishd/common/common_vsm.c
+++ b/bin/varnishd/common/common_vsm.c
@@ -49,10 +49,10 @@
 /*--------------------------------------------------------------------*/
 
 struct vsm_range {
-	unsigned 			magic;
+	unsigned			magic;
 #define VSM_RANGE_MAGIC			0x8d30f14
 	VTAILQ_ENTRY(vsm_range)		list;
-	ssize_t				off; 
+	ssize_t				off;
 	ssize_t				len;
 	double				cool;
 	struct VSM_chunk		*chunk;
@@ -60,7 +60,7 @@ struct vsm_range {
 };
 
 struct vsm_sc {
-	unsigned 			magic;
+	unsigned			magic;
 #define VSM_SC_MAGIC			0x8b83270d
 	char				*b;
 	ssize_t				len;
@@ -236,7 +236,7 @@ VSM_common_alloc(struct vsm_sc *sc, ssize_t size,
 	vr3 = VTAILQ_FIRST(&sc->r_used);
 	VTAILQ_INSERT_HEAD(&sc->r_used, vr, list);
 
-	if (vr3 != NULL) {	
+	if (vr3 != NULL) {
 		AZ(vr3->chunk->next);
 		vr3->chunk->next = vr->off;
 	} else {
diff --git a/bin/varnishd/mgt/mgt_shmem.c b/bin/varnishd/mgt/mgt_shmem.c
index 6bb8e13..40f0c24 100644
--- a/bin/varnishd/mgt/mgt_shmem.c
+++ b/bin/varnishd/mgt/mgt_shmem.c
@@ -26,62 +26,6 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *
- * TODO:
- *
- * There is a risk that the child process might corrupt the VSM segment
- * and we should capture that event and recover gracefully.
- *
- * A possible state diagram could be:
- *
- *	[manager start]
- *		|
- *		v
- *      Open old VSM,
- *	check pid	--------> exit/fail (-n message)
- *		|
- *		+<----------------------+
- *		|			^
- *		v			|
- *	Create new VSM			|
- *		|			|
- *		v			|
- *	Init header			|
- *	Alloc VSL			|
- *	Alloc VSC:Main			|
- *	Alloc Args etc.			|
- *		|			|
- *		+<--------------+	|
- *		|		^	|
- *		v		|	|
- *	start worker		|	|
- *		|		|	|
- *		|		|	+<---- worker crash
- *		v		|	^
- *	Reset VSL ptr.		|	|
- *	Reset VSC counters	|	|
- *		|		|	|
- *		+<------+	|	|
- *		|	^	|	|
- *		v	|	|	|
- *	alloc dynamics	|	|	|
- *	free dynamics	|	|	|
- *		|	|	|	|
- *		v	|	|	|
- *		+------>+	|	|
- *		|		|	|
- *		v		|	|
- *	stop worker		|	|
- *		|		|	|
- *		v		|	|
- *	Check consist---------- | ----->+
- *		|		|
- *		v		|
- *	Free dynamics		|
- *		|		|
- *		v		|
- *		+-------------->+
- *
  */
 
 #include "config.h"
@@ -241,7 +185,7 @@ mgt_SHM_Init(void)
 	bprintf(fnbuf, "%s.%jd", VSM_FILENAME, (intmax_t)getpid());
 
 	vsm_fd = vsm_zerofile(fnbuf, size);
-	if (vsm_fd < 0) 
+	if (vsm_fd < 0)
 		exit(1);
 
 	p = (void *)mmap(NULL, size,
diff --git a/lib/libvarnish/cli_common.c b/lib/libvarnish/cli_common.c
index aa5fd63..74c966f 100644
--- a/lib/libvarnish/cli_common.c
+++ b/lib/libvarnish/cli_common.c
@@ -212,7 +212,7 @@ VCLI_ReadResult(int fd, unsigned *status, char **ptr, double tmo)
 			break;
 		if (p[v] != '\n')
 			break;
-		
+
 		p[v] = '\0';
 		if (ptr == NULL)
 			free(p);
diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index 1e2206b..4fc2233 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -292,7 +292,7 @@ iter_call(const struct vsc *vsc, VSC_iter_f *func, void *priv,
 		int i;							\
 									\
 		CHECK_OBJ_NOTNULL(vsc, VSC_MAGIC);			\
-		st = vf->b; 						\
+		st = vf->b;						\
 		sp.class = t;						\
 		sp.ident = vf->chunk->ident;
 
diff --git a/lib/libvarnishapi/vsm.c b/lib/libvarnishapi/vsm.c
index 1669278..81007d8 100644
--- a/lib/libvarnishapi/vsm.c
+++ b/lib/libvarnishapi/vsm.c
@@ -141,7 +141,7 @@ VSM_Delete(struct VSM_data *vd)
  *
  * Return:
  *	0 = sucess
- * 	<0 = failure
+ *	<0 = failure
  *
  */
 



More information about the varnish-commit mailing list