Blame SOURCES/attr-2.4.44-warnings.patch

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