37911a
From 356db83c304052b89a431670ec35ce037a24bcb6 Mon Sep 17 00:00:00 2001
c8f3ff
From: Kamil Dudka <kdudka@redhat.com>
37911a
Date: Mon, 20 May 2013 12:56:50 +0200
37911a
Subject: [PATCH] attr-2.4.44-warnings.patch rebased for 2.4.47
c8f3ff
c8f3ff
---
a5a132
 attr/attr.c         |   10 ++++++++--
a5a132
 getfattr/getfattr.c |    6 ++++--
a5a132
 libmisc/quote.c     |    1 +
a5a132
 libmisc/walk_tree.c |    4 ++--
a5a132
 4 files changed, 15 insertions(+), 6 deletions(-)
a5a132
a5a132
diff --git a/attr/attr.c b/attr/attr.c
a5a132
index e4a8272..2b1ba6a 100644
a5a132
--- a/attr/attr.c
a5a132
+++ b/attr/attr.c
a5a132
@@ -173,9 +173,11 @@ main(int argc, char **argv)
a5a132
 			exit(1);
a5a132
 		}
a5a132
 		if (verbose) {
a5a132
+			int sink;
a5a132
 			printf(_("Attribute \"%s\" set to a %d byte value "
a5a132
 			       "for %s:\n"), attrname, attrlength, filename);
a5a132
-			fwrite(attrvalue, 1, attrlength, stdout);
a5a132
+			sink = fwrite(attrvalue, 1, attrlength, stdout);
a5a132
+			(void) sink;
a5a132
 			printf("\n");
a5a132
 		}
a5a132
 		break;
a5a132
@@ -199,7 +201,11 @@ main(int argc, char **argv)
a5a132
 			printf(_("Attribute \"%s\" had a %d byte value "
a5a132
 				"for %s:\n"), attrname, attrlength, filename);
a5a132
 		}
a5a132
-		fwrite(attrvalue, 1, attrlength, stdout);
a5a132
+		{
a5a132
+			/* silence compiler's warning */
a5a132
+			int sink = fwrite(attrvalue, 1, attrlength, stdout);
a5a132
+			(void) sink;
a5a132
+		}
a5a132
 		if (verbose) {
a5a132
 			printf("\n");
a5a132
 		}
a5a132
diff --git a/getfattr/getfattr.c b/getfattr/getfattr.c
37911a
index 692d2d8..88b59c6 100644
a5a132
--- a/getfattr/getfattr.c
a5a132
+++ b/getfattr/getfattr.c
37911a
@@ -275,8 +275,10 @@ int print_attribute(const char *path, const char *name, int *header_printed)
a5a132
 		*header_printed = 1;
a5a132
 	}
a5a132
 
a5a132
-	if (opt_value_only)
a5a132
-		fwrite(value, length, 1, stdout);
a5a132
+	if (opt_value_only) {
a5a132
+		int sink = fwrite(value, length, 1, stdout);
a5a132
+		(void) sink;
a5a132
+        }
a5a132
 	else if (length) {
a5a132
 		const char *enc = encode(value, &length);
a5a132
 		
a5a132
diff --git a/libmisc/quote.c b/libmisc/quote.c
c8f3ff
index bf8f9eb..8835af4 100644
a5a132
--- a/libmisc/quote.c
a5a132
+++ b/libmisc/quote.c
a5a132
@@ -19,6 +19,7 @@
a5a132
 
a5a132
 #include <stdio.h>
a5a132
 #include <stdlib.h>
a5a132
+#include <string.h>
a5a132
 #include <ctype.h>
c8f3ff
 #include <string.h>
a5a132
 #include "misc.h"
a5a132
diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
37911a
index 2be9d47..e7e654d 100644
a5a132
--- a/libmisc/walk_tree.c
a5a132
+++ b/libmisc/walk_tree.c
37911a
@@ -101,8 +101,8 @@ static int walk_tree_rec(const char *path, int walk_flags,
a5a132
 	 *      a dir not from a symlink
a5a132
 	 *      a link and follow_symlinks
a5a132
 	 */
a5a132
-        if ((flags & WALK_TREE_RECURSIVE) &&
a5a132
-	   (!(flags & WALK_TREE_SYMLINK) && S_ISDIR(st.st_mode)) ||
a5a132
+        if (((flags & WALK_TREE_RECURSIVE) &&
a5a132
+	   (!(flags & WALK_TREE_SYMLINK) && S_ISDIR(st.st_mode))) ||
a5a132
 	   ((flags & WALK_TREE_SYMLINK) && follow_symlinks)) {
a5a132
 		struct dirent *entry;
a5a132
 
c8f3ff
-- 
37911a
1.7.1
c8f3ff