[sheepdog] [PATCH 08/10] sheep: clear performance tips generated by cppcheck

Ruoyu liangry at ucweb.com
Tue Sep 2 11:14:11 CEST 2014


This patch gets rid of the below message while performing a code
analysis with cppcheck.

[sheep/sheep.c:197] -> [sheep/sheep.c:201]: (performance) Variable 'fd'
is reassigned a value before the old one has been used.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 sheep/sheep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/sheep.c b/sheep/sheep.c
index a36da17..328a7fe 100644
--- a/sheep/sheep.c
+++ b/sheep/sheep.c
@@ -194,7 +194,7 @@ static void sdlog_help(void)
 
 static int create_pidfile(const char *filename)
 {
-	int fd = -1;
+	int fd;
 	int len;
 	char buffer[128];
 
-- 
1.8.3.2





More information about the sheepdog mailing list