Blob Blame Raw
From 356db83c304052b89a431670ec35ce037a24bcb6 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 20 May 2013 12:56:50 +0200
Subject: [PATCH] attr-2.4.44-warnings.patch rebased for 2.4.47

---
 attr/attr.c         |   10 ++++++++--
 getfattr/getfattr.c |    6 ++++--
 libmisc/quote.c     |    1 +
 libmisc/walk_tree.c |    4 ++--
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/attr/attr.c b/attr/attr.c
index e4a8272..2b1ba6a 100644
--- a/attr/attr.c
+++ b/attr/attr.c
@@ -173,9 +173,11 @@ main(int argc, char **argv)
 			exit(1);
 		}
 		if (verbose) {
+			int sink;
 			printf(_("Attribute \"%s\" set to a %d byte value "
 			       "for %s:\n"), attrname, attrlength, filename);
-			fwrite(attrvalue, 1, attrlength, stdout);
+			sink = fwrite(attrvalue, 1, attrlength, stdout);
+			(void) sink;
 			printf("\n");
 		}
 		break;
@@ -199,7 +201,11 @@ main(int argc, char **argv)
 			printf(_("Attribute \"%s\" had a %d byte value "
 				"for %s:\n"), attrname, attrlength, filename);
 		}
-		fwrite(attrvalue, 1, attrlength, stdout);
+		{
+			/* silence compiler's warning */
+			int sink = fwrite(attrvalue, 1, attrlength, stdout);
+			(void) sink;
+		}
 		if (verbose) {
 			printf("\n");
 		}
diff --git a/getfattr/getfattr.c b/getfattr/getfattr.c
index 692d2d8..88b59c6 100644
--- a/getfattr/getfattr.c
+++ b/getfattr/getfattr.c
@@ -275,8 +275,10 @@ int print_attribute(const char *path, const char *name, int *header_printed)
 		*header_printed = 1;
 	}
 
-	if (opt_value_only)
-		fwrite(value, length, 1, stdout);
+	if (opt_value_only) {
+		int sink = fwrite(value, length, 1, stdout);
+		(void) sink;
+        }
 	else if (length) {
 		const char *enc = encode(value, &length);
 		
diff --git a/libmisc/quote.c b/libmisc/quote.c
index bf8f9eb..8835af4 100644
--- a/libmisc/quote.c
+++ b/libmisc/quote.c
@@ -19,6 +19,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 #include <string.h>
 #include "misc.h"
diff --git a/libmisc/walk_tree.c b/libmisc/walk_tree.c
index 2be9d47..e7e654d 100644
--- a/libmisc/walk_tree.c
+++ b/libmisc/walk_tree.c
@@ -101,8 +101,8 @@ static int walk_tree_rec(const char *path, int walk_flags,
 	 *      a dir not from a symlink
 	 *      a link and follow_symlinks
 	 */
-        if ((flags & WALK_TREE_RECURSIVE) &&
-	   (!(flags & WALK_TREE_SYMLINK) && S_ISDIR(st.st_mode)) ||
+        if (((flags & WALK_TREE_RECURSIVE) &&
+	   (!(flags & WALK_TREE_SYMLINK) && S_ISDIR(st.st_mode))) ||
 	   ((flags & WALK_TREE_SYMLINK) && follow_symlinks)) {
 		struct dirent *entry;
 
-- 
1.7.1