bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tail: adjust type of a local variable


From: Jim Meyering
Subject: [PATCH] tail: adjust type of a local variable
Date: Sat, 11 Jul 2009 09:46:31 +0200

I noticed new warnings:

    tail.c: In function ‘tail_forever_inotify’:
    tail.c:1256: warning: comparison between signed and unsigned
    tail.c:1263: warning: comparison between signed and unsigned
    tail.c:1272: warning: comparison between signed and unsigned

and fixed it like this:

>From 8f3171bbc463d813f17f0dfec22f7074142675d8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 11 Jul 2009 09:43:25 +0200
Subject: [PATCH] tail: adjust type of a local variable

* src/tail.c (tail_forever_inotify): Declare "len" to be of type
size_t, not ssize_t, since the former is what safe_read returns.
---
 src/tail.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/tail.c b/src/tail.c
index 2ac62b2..fd44e22 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1173,7 +1173,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t 
n_files)
   size_t evlen = 0;
   char *evbuf;
   size_t evbuf_off = 0;
-  ssize_t len = 0;
+  size_t len = 0;

   wd_table = hash_initialize (n_files, NULL, wd_hasher, wd_comparator, NULL);
   if (! wd_table)
--
1.6.3.3.524.g8586b




reply via email to

[Prev in Thread] Current Thread [Next in Thread]