diff options
author | James Youngman <jay@gnu.org> | 2011-06-03 01:11:57 +0100 |
---|---|---|
committer | James Youngman <jay@gnu.org> | 2011-06-04 00:38:47 +0100 |
commit | d13223b942fbb6cac8b8fd548f69b31055d543e9 (patch) | |
tree | 56d5acde738a29db4e3bee29762af77b47eabdb0 | |
parent | 9ab5022447040f3800a57b51138309d19f173114 (diff) | |
download | findutils-d13223b942fbb6cac8b8fd548f69b31055d543e9.tar.gz |
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).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/fdleak.c | 10 |
2 files changed, 11 insertions, 5 deletions
@@ -1,5 +1,11 @@ 2011-06-03 James Youngman <jay@gnu.org> + 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 ac8d8b05..c94275bd 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; } } |