Blame SOURCES/attr-2.4.44-warnings.patch

b53709
From b01c9a5805632167acc4c669852093555bfc10ae Mon Sep 17 00:00:00 2001
b53709
From: Kamil Dudka <kdudka@redhat.com>
b53709
Date: Tue, 19 Apr 2011 08:48:53 +0200
b53709
Subject: [PATCH] fix compile-time warnings in attr-2.4.45
b53709
b53709
---
b53709
 attr/attr.c         |   10 ++++++++--
b53709
 getfattr/getfattr.c |    6 ++++--
b53709
 libmisc/quote.c     |    1 +
b53709
 libmisc/walk_tree.c |    4 ++--
b53709
 4 files changed, 15 insertions(+), 6 deletions(-)
b53709
b53709
diff --git a/attr/attr.c b/attr/attr.c
b53709
index e4a8272..2b1ba6a 100644
b53709
--- a/attr/attr.c
b53709
+++ b/attr/attr.c
b53709
@@ -173,9 +173,11 @@ main(int argc, char **argv)
b53709
 			exit(1);
b53709
 		}
b53709
 		if (verbose) {
b53709
+			int sink;
b53709
 			printf(_("Attribute \"%s\" set to a %d byte value "
b53709
 			       "for %s:\n"), attrname, attrlength, filename);
b53709
-			fwrite(attrvalue, 1, attrlength, stdout);
b53709
+			sink = fwrite(attrvalue, 1, attrlength, stdout);
b53709
+			(void) sink;
b53709
 			printf("\n");
b53709
 		}
b53709
 		break;
b53709
@@ -199,7 +201,11 @@ main(int argc, char **argv)
b53709
 			printf(_("Attribute \"%s\" had a %d byte value "
b53709
 				"for %s:\n"), attrname, attrlength, filename);
b53709
 		}
b53709
-		fwrite(attrvalue, 1, attrlength, stdout);
b53709
+		{
b53709
+			/* silence compiler's warning */
b53709
+			int sink = fwrite(attrvalue, 1, attrlength, stdout);
b53709
+			(void) sink;
b53709
+		}
b53709
 		if (verbose) {
b53709
 			printf("\n");
b53709
 		}
b53709
diff --git a/getfattr/getfattr.c b/getfattr/getfattr.c
b53709
index 9c3de32..7ced700 100644
b53709
--- a/getfattr/getfattr.c
b53709
+++ b/getfattr/getfattr.c
b53709
@@ -274,8 +274,10 @@ int print_attribute(const char *path, const char *name, int *header_printed)
b53709
 		*header_printed = 1;
b53709
 	}
b53709
 
b53709
-	if (opt_value_only)
b53709
-		fwrite(value, length, 1, stdout);
b53709
+	if (opt_value_only) {
b53709
+		int sink = fwrite(value, length, 1, stdout);
b53709
+		(void) sink;
b53709
+        }
b53709
 	else if (length) {
b53709
 		const char *enc = encode(value, &length);
b53709
 		
b53709
diff --git a/libmisc/quote.c b/libmisc/quote.c
b53709
index bf8f9eb..8835af4 100644
b53709
--- a/libmisc/quote.c
b53709
+++ b/libmisc/quote.c
b53709
@@ -19,6 +19,7 @@
b53709
 
b53709
 #include <stdio.h>
b53709
 #include <stdlib.h>
b53709
+#include <string.h>
b53709
 #include <ctype.h>
b53709
 #include <string.h>
b53709
 #include "misc.h"
b53709
diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
b53709
index 30ff92a..b87c35c 100644
b53709
--- a/libmisc/walk_tree.c
b53709
+++ b/libmisc/walk_tree.c
b53709
@@ -100,8 +100,8 @@ static int walk_tree_rec(const char *path, int walk_flags,
b53709
 	 *      a dir not from a symlink
b53709
 	 *      a link and follow_symlinks
b53709
 	 */
b53709
-        if ((flags & WALK_TREE_RECURSIVE) &&
b53709
-	   (!(flags & WALK_TREE_SYMLINK) && S_ISDIR(st.st_mode)) ||
b53709
+        if (((flags & WALK_TREE_RECURSIVE) &&
b53709
+	   (!(flags & WALK_TREE_SYMLINK) && S_ISDIR(st.st_mode))) ||
b53709
 	   ((flags & WALK_TREE_SYMLINK) && follow_symlinks)) {
b53709
 		struct dirent *entry;
b53709
 
b53709
-- 
b53709
1.7.4.2
b53709