[sheepdog] [PATCH] fix style-check warnings

Liu Yuan namei.unix at gmail.com
Fri May 31 06:54:55 CEST 2013


Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 collie/farm/snap.c |    5 ++---
 lib/logger.c       |    2 +-
 sheep/request.c    |    2 +-
 sheep/store.c      |    5 ++---
 sheep/vdi.c        |    2 +-
 sheepfs/core.c     |    2 +-
 6 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/collie/farm/snap.c b/collie/farm/snap.c
index 9f8370e..f28601a 100644
--- a/collie/farm/snap.c
+++ b/collie/farm/snap.c
@@ -13,9 +13,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-/*
- * Snap object is the meta data that describes the cluster snapshot.
- */
+/* Snap object is the meta data that describes the cluster snapshot. */
+
 #include <time.h>
 #include <sys/stat.h>
 #include <unistd.h>
diff --git a/lib/logger.c b/lib/logger.c
index d359b4d..ba9f5db 100644
--- a/lib/logger.c
+++ b/lib/logger.c
@@ -39,7 +39,7 @@
 #include "util.h"
 
 static bool colorize;
-static const char *log_color[] = {
+static const char * const log_color[] = {
 	[SDOG_EMERG] = TEXT_BOLD_RED,
 	[SDOG_ALERT] = TEXT_BOLD_RED,
 	[SDOG_CRIT] = TEXT_BOLD_RED,
diff --git a/sheep/request.c b/sheep/request.c
index e99f6f2..e069d76 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -882,7 +882,7 @@ int create_listen_port(char *bindaddr, int port)
 
 int init_unix_domain_socket(const char *dir)
 {
-	static bool is_inet_socket = false;
+	static bool is_inet_socket;
 	char unix_path[PATH_MAX];
 
 	snprintf(unix_path, sizeof(unix_path), "%s/sock", dir);
diff --git a/sheep/store.c b/sheep/store.c
index ea2cfb0..658904b 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -213,11 +213,10 @@ int lock_base_dir(const char *d)
 	}
 
 	if (lockf(fd, F_TLOCK, 1) < 0) {
-		if (errno == EACCES || errno == EAGAIN) {
+		if (errno == EACCES || errno == EAGAIN)
 			sd_eprintf("another sheep daemon is using %s", d);
-		} else {
+		else
 			sd_eprintf("unable to get base dir lock (%m)");
-		}
 		ret = -1;
 		goto out;
 	}
diff --git a/sheep/vdi.c b/sheep/vdi.c
index 6120068..ff16a07 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -91,7 +91,7 @@ bool oid_is_readonly(uint64_t oid)
 {
 	/* we allow changing snapshot attributes */
 	if (!is_data_obj(oid))
-	    return false;
+		return false;
 
 	return vid_is_snapshot(oid_to_vid(oid));
 }
diff --git a/sheepfs/core.c b/sheepfs/core.c
index 5553b09..07117b1 100644
--- a/sheepfs/core.c
+++ b/sheepfs/core.c
@@ -34,7 +34,7 @@ char sheepfs_shadow[PATH_MAX];
 
 static int sheepfs_debug;
 static int sheepfs_fg;
-int sheepfs_page_cache = false;
+int sheepfs_page_cache;
 int sheepfs_object_cache = true;
 char sdhost[32] = "localhost";
 int sdport = SD_LISTEN_PORT;
-- 
1.7.9.5




More information about the sheepdog mailing list