Blame SOURCES/attr-2.4.44-warnings.patch

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