tony2001                                 Mon, 11 Jan 2010 13:09:46 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=293404

Log:
fix CS/WS

Changed paths:
    U   php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_conf.c
    U   php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_env.c
    U   php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_request.c
    U   php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_status.c

Modified: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_conf.c
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_conf.c	2010-01-11 13:03:19 UTC (rev 293403)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_conf.c	2010-01-11 13:09:46 UTC (rev 293404)
@@ -402,7 +402,7 @@

 		if (wp->config->pm == NULL) {
 			zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] the process manager is missing (static or dynamic)", wp->config->name);
-			return(-1);
+			return -1;
 		}

 		if (wp->config->pm->style == PM_STYLE_DYNAMIC) {
@@ -410,24 +410,24 @@

 			if (pm->dynamic.min_spare_servers <= 0) {
 				zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] min_spare_servers(%d) must be a positive value", wp->config->name, pm->dynamic.min_spare_servers);
-				return(-1);
+				return -1;
 			}

 			if (pm->dynamic.max_spare_servers <= 0) {
 				zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] max_spare_servers(%d) must be a positive value", wp->config->name, pm->dynamic.max_spare_servers);
-				return(-1);
+				return -1;
 			}

 			if (pm->dynamic.min_spare_servers > pm->max_children ||
 			    pm->dynamic.max_spare_servers > pm->max_children) {
 				zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] min_spare_servers(%d) and max_spare_servers(%d) cannot be greater than max_children(%d)",
 				     wp->config->name, pm->dynamic.min_spare_servers, pm->dynamic.max_spare_servers, pm->max_children);
-				return(-1);
+				return -1;
 			}

 			if (pm->dynamic.max_spare_servers < pm->dynamic.min_spare_servers) {
 				zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] max_spare_servers(%d) must not be less than min_spare_servers(%d)", wp->config->name, pm->dynamic.max_spare_servers, pm->dynamic.min_spare_servers);
-				return(-1);
+				return -1;
 			}

 			if (pm->dynamic.start_servers <= 0) {
@@ -435,7 +435,7 @@
 				zlog(ZLOG_STUFF, ZLOG_NOTICE, "[pool %s] start_servers has been set to %d", wp->config->name, pm->dynamic.start_servers);
 			} else if (pm->dynamic.start_servers < pm->dynamic.min_spare_servers || pm->dynamic.start_servers > pm->dynamic.max_spare_servers) {
 				zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] start_servers(%d) must not be less than min_spare_servers(%d) and not greater than max_spare_servers(%d)", wp->config->name, pm->dynamic.start_servers, pm->dynamic.min_spare_servers, pm->dynamic.max_spare_servers);
-				return(-1);
+				return -1;
 			}
 		}

@@ -482,18 +482,18 @@

 			if (*ping != '/') {
 				zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the ping page '%s' must start with a '/'", wp->config->name, ping);
-				return(-1);
+				return -1;
 			}

 			if (strlen(ping) < 2) {
 				zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the ping page '%s' is not long enough", wp->config->name, ping);
-				return(-1);
+				return -1;
 			}

 			for (i=0; i<strlen(ping); i++) {
 				if (!isalnum(ping[i]) && ping[i] != '/' && ping[i] != '-' && ping[i] != '_' && ping[i] != '.') {
 					zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the ping page '%s' must containt only the following characters '[alphanum]/_-.'", wp->config->name, ping);
-					return(-1);
+					return -1;
 				}
 			}

@@ -502,7 +502,7 @@
 			} else {
 				if (strlen(wp->config->pm->pong) < 1) {
 					zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the ping response page '%s' is not long enough", wp->config->name, wp->config->pm->pong);
-					return(-1);
+					return -1;
 				}
 			}
 		} else {
@@ -519,24 +519,24 @@

 			if (*status != '/') {
 				zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the status page '%s' must start with a '/'", wp->config->name, status);
-				return(-1);
+				return -1;
 			}

 			if (strlen(status) < 2) {
 				zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the status page '%s' is not long enough", wp->config->name, status);
-				return(-1);
+				return -1;
 			}

 			for (i=0; i<strlen(status); i++) {
 				if (!isalnum(status[i]) && status[i] != '/' && status[i] != '-' && status[i] != '_' && status[i] != '.') {
 					zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the status page '%s' must containt only the following characters '[alphanum]/_-.'", wp->config->name, status);
-					return(-1);
+					return -1;
 				}
 			}
 			wp->shm_status = fpm_shm_alloc(sizeof(struct fpm_status_s));
 			if (!wp->shm_status) {
 				zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] unable to allocate shared memory for status page '%s'", wp->config->name, status);
-				return(-1);
+				return -1;
 			}
 			fpm_status_update_accepted_conn(wp->shm_status, 0);
 			fpm_status_update_activity(wp->shm_status, -1, -1, -1, 1);

Modified: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_env.c
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_env.c	2010-01-11 13:03:19 UTC (rev 293403)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_env.c	2010-01-11 13:09:46 UTC (rev 293404)
@@ -106,7 +106,7 @@
 	if(*s1 == '\0' && *(s2-1) == '=') {
 		return s2;
 	}
-	return(NULL);
+	return NULL;
 }
 /* }}} */
 #endif

Modified: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_request.c
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_request.c	2010-01-11 13:03:19 UTC (rev 293403)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_request.c	2010-01-11 13:09:46 UTC (rev 293404)
@@ -159,7 +159,7 @@

 	slot = fpm_shm_slot(child);
 	if (!fpm_shm_slots_acquire(slot, 1)) {
-		return(-1);
+		return -1;
 	}

 	slot_c = *slot;

Modified: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_status.c
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_status.c	2010-01-11 13:03:19 UTC (rev 293403)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_status.c	2010-01-11 13:09:46 UTC (rev 293404)
@@ -21,13 +21,13 @@
 {
 	if (!wp || !wp->config) {
 		zlog(ZLOG_STUFF, ZLOG_ERROR, "unable to init fpm_status because conf structure is NULL");
-		return(-1);
+		return -1;
 	}
 	if (wp->config->pm->status || wp->config->pm->ping) {
 		if (wp->config->pm->status) {
 			if (!wp->shm_status) {
 				zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] unable to init fpm_status because the dedicated SHM has not been set", wp->config->name);
-				return(-1);
+				return -1;
 			}
 			fpm_status_shm = wp->shm_status;
 		}
@@ -38,13 +38,13 @@
 		if (wp->config->pm->ping) {
 			if (!wp->config->pm->pong) {
 				zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] ping is set (%s) but pong is not set.", wp->config->name, wp->config->pm->ping);
-				return(-1);
+				return -1;
 			}
 			fpm_status_ping = strdup(wp->config->pm->ping);
 			fpm_status_pong = strdup(wp->config->pm->pong);
 		}
 	}
-	return(0);
+	return 0;
 }
 /* }}} */

@@ -63,6 +63,7 @@
 	/* one shot operation */
 	*(struct fpm_status_s *)shm->mem = status;
 }
+/* }}} */

 void fpm_status_increment_accepted_conn(struct fpm_shm_s *shm) /* {{{ */
 {
@@ -127,20 +128,29 @@
 	struct fpm_status_s status;
 	if (!fpm_status_shm || !fpm_status_shm->mem) {
 		zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] unable to access status shared memory", fpm_status_pool);
-		return(0);
+		return 0;
 	}
 	if (!idle || !active || !total) {
 		zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] unable to get status information : pointers are NULL", fpm_status_pool);
-		return(0);
+		return 0;
 	}

 	/* one shot operation */
 	status = *(struct fpm_status_s *)fpm_status_shm->mem;

-	if (idle) *idle = status.idle;
-	if (active) *active = status.active;
-	if (total) *total = status.total;
-	if (pm) *pm = status.pm;
+	if (idle) {
+		*idle = status.idle;
+	}
+	if (active) {
+		*active = status.active;
+	}
+	if (total) {
+		*total = status.total;
+	}
+	if (pm) {
+		*pm = status.pm;
+	}
+	return 1;
 }
 /* }}} */

@@ -215,27 +225,27 @@
 	struct fpm_status_s status;

 	if (!fpm_status_uri || !uri) {
-		return(0);
+		return 0;
 	}

 	/* It's not the status page */
 	if (strcmp(fpm_status_uri, uri)) {
-		return(0);
+		return 0;
 	}

 	if (!output || !content_type || !fpm_status_shm) {
-		return(1);
+		return 1;
 	}

 	if (!fpm_status_shm->mem) {
-		return(1);
+		return 1;
 	}

 	/* one shot operation */
 	status = *(struct fpm_status_s *)fpm_status_shm->mem;

 	if (status.idle < 0 || status.active < 0 || status.total < 0) {
-		return(1);
+		return 1;
 	}

 	if (query_string && strstr(query_string, "html")) {
@@ -248,25 +258,25 @@

 	if (!*output || !content_type) {
 		zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] unable to allocate status ouput buffer", fpm_status_pool);
-		return(1);
+		return 1;
 	}

-	return(1);
+	return 1;
 }
 /* }}} */

 char *fpm_status_handle_ping(char *uri) /* {{{ */
 {
 	if (!fpm_status_ping || !fpm_status_pong || !uri) {
-		return(NULL);
+		return NULL;
 	}

 	/* It's not the status page */
 	if (strcmp(fpm_status_ping, uri)) {
-		return(NULL);
+		return NULL;
 	}

-	return(fpm_status_pong);
+	return fpm_status_pong;
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to