summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-07-08 19:49:46 +0200
committerJim Meyering <meyering@redhat.com>2009-07-08 19:53:43 +0200
commit0e931753015889598af771b5399ea6fa4c4f9619 (patch)
treebbf5a5ff7405a7c1ffcfe6a92066705593df34bb /src/tail.c
parent3639a880aa9778bd6f30be4e953ad9b1171110a1 (diff)
downloadcoreutils-0e931753015889598af771b5399ea6fa4c4f9619.tar.xz
tail: use size_t for counter and index variables, ...
* src/tail.c (any_live_files): ... not "int" or even unsigned int (tail_forever, tail_forever_inotify, main): Likewise.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tail.c b/src/tail.c
index 79c557636..2ac62b229 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -978,9 +978,9 @@ recheck (struct File_spec *f, bool blocking)
open file descriptors. */
static bool
-any_live_files (const struct File_spec *f, int n_files)
+any_live_files (const struct File_spec *f, size_t n_files)
{
- int i;
+ size_t i;
for (i = 0; i < n_files; i++)
if (0 <= f[i].fd)
@@ -996,19 +996,19 @@ any_live_files (const struct File_spec *f, int n_files)
while and try again. Continue until the user interrupts us. */
static void
-tail_forever (struct File_spec *f, int n_files, double sleep_interval)
+tail_forever (struct File_spec *f, size_t n_files, double sleep_interval)
{
/* Use blocking I/O as an optimization, when it's easy. */
bool blocking = (pid == 0 && follow_mode == Follow_descriptor
&& n_files == 1 && ! S_ISREG (f[0].mode));
- int last;
+ size_t last;
bool writer_is_dead = false;
last = n_files - 1;
while (1)
{
- int i;
+ size_t i;
bool any_input = false;
for (i = 0; i < n_files; i++)
@@ -1162,9 +1162,9 @@ wd_comparator (const void *e1, const void *e2)
Check modifications using the inotify events system. */
static void
-tail_forever_inotify (int wd, struct File_spec *f, int n_files)
+tail_forever_inotify (int wd, struct File_spec *f, size_t n_files)
{
- unsigned int i;
+ size_t i;
unsigned int max_realloc = 3;
Hash_table *wd_table;
@@ -1833,10 +1833,10 @@ main (int argc, char **argv)
the number of items at the end of the file to print. Although the type
is signed, the value is never negative. */
uintmax_t n_units = DEFAULT_N_LINES;
- int n_files;
+ size_t n_files;
char **file;
struct File_spec *F;
- int i;
+ size_t i;
bool obsolete_option;
/* The number of seconds to sleep between iterations.