|
|
e0bc27 |
From 1b7065f25457fea9f9ee7100437b12815b92a38c Mon Sep 17 00:00:00 2001
|
|
|
e0bc27 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
e0bc27 |
Date: Wed, 11 May 2011 16:46:57 +0200
|
|
|
e0bc27 |
Subject: [PATCH 4/4] findutils-4.5.7-warnings.patch
|
|
|
e0bc27 |
|
|
|
e0bc27 |
---
|
|
|
e0bc27 |
find/Makefile.am | 2 +-
|
|
|
e0bc27 |
find/defs.h | 2 +-
|
|
|
e0bc27 |
find/exec.c | 2 +-
|
|
|
e0bc27 |
find/find.c | 14 +-------------
|
|
|
e0bc27 |
find/pred.c | 2 +-
|
|
|
e0bc27 |
lib/Makefile.am | 2 +-
|
|
|
e0bc27 |
xargs/Makefile.am | 2 +-
|
|
|
e0bc27 |
xargs/xargs.c | 5 +++--
|
|
|
e0bc27 |
8 files changed, 10 insertions(+), 21 deletions(-)
|
|
|
e0bc27 |
|
|
|
e0bc27 |
diff --git a/find/Makefile.am b/find/Makefile.am
|
|
|
e0bc27 |
index 0795b87..f1068bf 100644
|
|
|
e0bc27 |
--- a/find/Makefile.am
|
|
|
e0bc27 |
+++ b/find/Makefile.am
|
|
|
e0bc27 |
@@ -36,7 +36,7 @@ endif
|
|
|
e0bc27 |
# We don't just include man_MANS in EXTRA_DIST because while the value of
|
|
|
e0bc27 |
# man_MANS is not always the same, we want to distribute all of those files.
|
|
|
e0bc27 |
EXTRA_DIST = defs.h sharefile.h print.h find.1 ftsfind.1 oldfind.1
|
|
|
e0bc27 |
-INCLUDES = -I../gl/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gl/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
|
|
|
e0bc27 |
+AM_CPPFLAGS = -I../gl/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gl/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
|
|
|
e0bc27 |
LDADD = ./libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_CLOSE) $(MODF_LIBM) $(FINDLIBS) $(GETHOSTNAME_LIB) $(LIB_EACCESS)
|
|
|
e0bc27 |
# gnulib advises we link against <first> because we use <second>:
|
|
|
e0bc27 |
# $(GETHOSTNAME_LIB) uname
|
|
|
e0bc27 |
diff --git a/find/defs.h b/find/defs.h
|
|
|
e0bc27 |
index 366edab..f25b700 100644
|
|
|
e0bc27 |
--- a/find/defs.h
|
|
|
e0bc27 |
+++ b/find/defs.h
|
|
|
e0bc27 |
@@ -258,7 +258,7 @@ struct predicate
|
|
|
e0bc27 |
|
|
|
e0bc27 |
/* Only used for debugging, but defined unconditionally so individual
|
|
|
e0bc27 |
modules can be compiled with -DDEBUG. */
|
|
|
e0bc27 |
- char *p_name;
|
|
|
e0bc27 |
+ const char *p_name;
|
|
|
e0bc27 |
|
|
|
e0bc27 |
/* The type of this node. There are two kinds. The first is real
|
|
|
e0bc27 |
predicates ("primaries") such as -perm, -print, or -exec. The
|
|
|
e0bc27 |
diff --git a/find/exec.c b/find/exec.c
|
|
|
e0bc27 |
index aa69fe3..f731d82 100644
|
|
|
e0bc27 |
--- a/find/exec.c
|
|
|
e0bc27 |
+++ b/find/exec.c
|
|
|
e0bc27 |
@@ -324,7 +324,7 @@ launch (struct buildcmd_control *ctl, void *usercontext, int argc, char **argv)
|
|
|
e0bc27 |
}
|
|
|
e0bc27 |
}
|
|
|
e0bc27 |
|
|
|
e0bc27 |
- if (bc_args_exceed_testing_limit (argv))
|
|
|
e0bc27 |
+ if (bc_args_exceed_testing_limit ((const char **) argv))
|
|
|
e0bc27 |
errno = E2BIG;
|
|
|
e0bc27 |
else
|
|
|
e0bc27 |
execvp (argv[0], argv);
|
|
|
e0bc27 |
diff --git a/find/find.c b/find/find.c
|
|
|
e0bc27 |
index 5d287b5..00a2a6c 100644
|
|
|
e0bc27 |
--- a/find/find.c
|
|
|
e0bc27 |
+++ b/find/find.c
|
|
|
e0bc27 |
@@ -528,6 +528,7 @@ wd_sanity_check (const char *thing_to_stat,
|
|
|
e0bc27 |
#ifdef STAT_MOUNTPOINTS
|
|
|
e0bc27 |
isfatal = dirchange_is_fatal (specific_what,isfatal,silent,newinfo);
|
|
|
e0bc27 |
#else
|
|
|
e0bc27 |
+ (void) silent;
|
|
|
e0bc27 |
isfatal = RETRY_IF_SANITY_CHECK_FAILS;
|
|
|
e0bc27 |
#endif
|
|
|
e0bc27 |
}
|
|
|
e0bc27 |
@@ -1302,7 +1303,6 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp,
|
|
|
e0bc27 |
{
|
|
|
e0bc27 |
int subdirs_left; /* Number of unexamined subdirs in PATHNAME. */
|
|
|
e0bc27 |
bool subdirs_unreliable; /* if true, cannot use dir link count as subdir limif (if false, it may STILL be unreliable) */
|
|
|
e0bc27 |
- unsigned int idx; /* Which entry are we on? */
|
|
|
e0bc27 |
struct stat stat_buf;
|
|
|
e0bc27 |
size_t dircount = 0u;
|
|
|
e0bc27 |
DIR *dirp;
|
|
|
e0bc27 |
@@ -1519,7 +1519,6 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp,
|
|
|
e0bc27 |
if (strcmp (name, "."))
|
|
|
e0bc27 |
{
|
|
|
e0bc27 |
enum SafeChdirStatus status;
|
|
|
e0bc27 |
- struct dir_id did;
|
|
|
e0bc27 |
|
|
|
e0bc27 |
/* We could go back and do the next command-line arg
|
|
|
e0bc27 |
instead, maybe using longjmp. */
|
|
|
e0bc27 |
@@ -1555,17 +1554,6 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp,
|
|
|
e0bc27 |
"%s", safely_quote_err_filename (0, pathname));
|
|
|
e0bc27 |
return;
|
|
|
e0bc27 |
}
|
|
|
e0bc27 |
-
|
|
|
e0bc27 |
- if (dir_curr > 0)
|
|
|
e0bc27 |
- {
|
|
|
e0bc27 |
- did.dev = dir_ids[dir_curr-1].dev;
|
|
|
e0bc27 |
- did.ino = dir_ids[dir_curr-1].ino;
|
|
|
e0bc27 |
- }
|
|
|
e0bc27 |
- else
|
|
|
e0bc27 |
- {
|
|
|
e0bc27 |
- did.dev = starting_stat_buf.st_dev;
|
|
|
e0bc27 |
- did.ino = starting_stat_buf.st_ino;
|
|
|
e0bc27 |
- }
|
|
|
e0bc27 |
}
|
|
|
e0bc27 |
|
|
|
e0bc27 |
free (cur_path);
|
|
|
e0bc27 |
diff --git a/find/pred.c b/find/pred.c
|
|
|
e0bc27 |
index 88dacd9..e9c9a49 100644
|
|
|
e0bc27 |
--- a/find/pred.c
|
|
|
e0bc27 |
+++ b/find/pred.c
|
|
|
e0bc27 |
@@ -1216,7 +1216,7 @@ pred_context (const char *pathname, struct stat *stat_buf,
|
|
|
e0bc27 |
Return BUF. */
|
|
|
e0bc27 |
|
|
|
e0bc27 |
static char *
|
|
|
e0bc27 |
-blank_rtrim (char *str, char *buf)
|
|
|
e0bc27 |
+blank_rtrim (const char *str, char *buf)
|
|
|
e0bc27 |
{
|
|
|
e0bc27 |
int i;
|
|
|
e0bc27 |
|
|
|
e0bc27 |
diff --git a/lib/Makefile.am b/lib/Makefile.am
|
|
|
e0bc27 |
index bbb4dc2..eba43d2 100644
|
|
|
e0bc27 |
--- a/lib/Makefile.am
|
|
|
e0bc27 |
+++ b/lib/Makefile.am
|
|
|
e0bc27 |
@@ -28,7 +28,7 @@ DISTCLEANFILES =
|
|
|
e0bc27 |
MAINTAINERCLEANFILES =
|
|
|
e0bc27 |
|
|
|
e0bc27 |
|
|
|
e0bc27 |
-INCLUDES = -I../gl/lib -I$(top_srcdir)/gl/lib
|
|
|
e0bc27 |
+AM_CPPFLAGS = -I../gl/lib -I$(top_srcdir)/gl/lib
|
|
|
e0bc27 |
LDADD = ../gl/lib/libgnulib.a $(LIBINTL)
|
|
|
e0bc27 |
|
|
|
e0bc27 |
libfind_a_SOURCES += printquoted.h listfile.h \
|
|
|
e0bc27 |
diff --git a/xargs/Makefile.am b/xargs/Makefile.am
|
|
|
e0bc27 |
index d34f87a..1cfe3e4 100644
|
|
|
e0bc27 |
--- a/xargs/Makefile.am
|
|
|
e0bc27 |
+++ b/xargs/Makefile.am
|
|
|
e0bc27 |
@@ -3,7 +3,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
|
|
|
e0bc27 |
localedir = $(datadir)/locale
|
|
|
e0bc27 |
bin_PROGRAMS = xargs
|
|
|
e0bc27 |
man_MANS = xargs.1
|
|
|
e0bc27 |
-INCLUDES = -I.. -I../gl/lib -I$(top_srcdir)/gl/lib -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
|
|
|
e0bc27 |
+AM_CPPFLAGS = -I.. -I../gl/lib -I$(top_srcdir)/gl/lib -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
|
|
|
e0bc27 |
LDADD = ../lib/libfind.a ../gl/lib/libgnulib.a $(LIB_CLOSE) $(LIBINTL)
|
|
|
e0bc27 |
EXTRA_DIST = $(man_MANS)
|
|
|
e0bc27 |
SUBDIRS = . testsuite
|
|
|
e0bc27 |
diff --git a/xargs/xargs.c b/xargs/xargs.c
|
|
|
e0bc27 |
index 3cc1832..35f6822 100644
|
|
|
e0bc27 |
--- a/xargs/xargs.c
|
|
|
e0bc27 |
+++ b/xargs/xargs.c
|
|
|
e0bc27 |
@@ -1208,7 +1208,7 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
|
|
|
e0bc27 |
|
|
|
e0bc27 |
prep_child_for_exec ();
|
|
|
e0bc27 |
|
|
|
e0bc27 |
- if (bc_args_exceed_testing_limit (argv))
|
|
|
e0bc27 |
+ if (bc_args_exceed_testing_limit ((const char **) argv))
|
|
|
e0bc27 |
errno = E2BIG;
|
|
|
e0bc27 |
else
|
|
|
e0bc27 |
execvp (argv[0], argv);
|
|
|
e0bc27 |
@@ -1226,7 +1226,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
|
|
|
e0bc27 |
* utility if we run it, for POSIX compliance on the
|
|
|
e0bc27 |
* handling of exit values.
|
|
|
e0bc27 |
*/
|
|
|
e0bc27 |
- write (fd[1], &errno, sizeof (int));
|
|
|
e0bc27 |
+ int sink = write (fd[1], &errno, sizeof (int));
|
|
|
e0bc27 |
+ (void) sink;
|
|
|
e0bc27 |
}
|
|
|
e0bc27 |
|
|
|
e0bc27 |
close (fd[1]);
|
|
|
e0bc27 |
--
|
|
|
e0bc27 |
1.7.4.4
|
|
|
e0bc27 |
|