[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/9] Fix compiler warnings in lib/fdleak.c
From: |
James Youngman |
Subject: |
[PATCH 4/9] Fix compiler warnings in lib/fdleak.c |
Date: |
Sat, 4 Jun 2011 01:21:48 +0100 |
* lib/fdleak.c (visit_open_fds): Rename loop variable from i to j
to avoid shadowing.
(get_proc_max_fd): Fix definition (it's a void function, not a
traditional pre-ANSI function definition).
---
ChangeLog | 6 ++++++
lib/fdleak.c | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f84b5c7..bba9198 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-06-03 James Youngman <address@hidden>
+ Fix compiler warnings in lib/fdleak.c
+ * lib/fdleak.c (visit_open_fds): Rename loop variable from i to j
+ to avoid shadowing.
+ (get_proc_max_fd): Fix definition (it's a void function, not a
+ traditional pre-ANSI function definition).
+
Fix several small compiler warnings.
* lib/dircallback.c: Include dircallback.h.
* lib/dircallback.h: Correct declaration of run_in_dir.
diff --git a/lib/fdleak.c b/lib/fdleak.c
index ac8d8b0..c94275b 100644
--- a/lib/fdleak.c
+++ b/lib/fdleak.c
@@ -66,7 +66,7 @@ static size_t num_cloexec_fds;
/* Determine the value of the largest open fd, on systems that
* offer /proc/self/fd. */
static int
-get_proc_max_fd ()
+get_proc_max_fd (void)
{
const char *path = "/proc/self/fd";
int maxfd = -1;
@@ -160,12 +160,12 @@ visit_open_fds (int fd_min, int fd_max,
}
else
{
- int i;
- for (i=0; i<limit; i++)
+ int j;
+ for (j=0; j<limit; j++)
{
- if (pf[i].revents != POLLNVAL)
+ if (pf[j].revents != POLLNVAL)
{
- if (0 != (rv = callback (pf[i].fd, cb_context)))
+ if (0 != (rv = callback (pf[j].fd, cb_context)))
return rv;
}
}
--
1.7.2.5
- [PATCH 1/9] Don't display a separate gnulib version., James Youngman, 2011/06/03
- [PATCH 2/9] Fix some compiler warnings in findutils-version.c., James Youngman, 2011/06/03
- [PATCH 4/9] Fix compiler warnings in lib/fdleak.c,
James Youngman <=
- [PATCH 5/9] Fix a compiler warning in lib/buildcmd.c, James Youngman, 2011/06/03
- [PATCH 9/9] Compiler warning fixes in find/pred.c., James Youngman, 2011/06/03
- [PATCH 7/9] Avoid code redundancy in lib/buildcmd.c., James Youngman, 2011/06/03
- [PATCH 8/9] Eliminate some compiler warnings in parser.c, James Youngman, 2011/06/03
- [PATCH 6/9] Eliminate some compiler warnings in find/parser.c., James Youngman, 2011/06/03
- [PATCH 3/9] Fix several small compiler warnings., James Youngman, 2011/06/03