summaryrefslogtreecommitdiffstats
path: root/daemon/inotify.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-06 16:05:44 +0200
committerJim Meyering <meyering@redhat.com>2009-08-10 11:53:33 +0200
commit98869b86413ff59afa009f9d06ebc0cc4477ab31 (patch)
treedf85f54f8004e096986448eb8ce4feea6c8978e2 /daemon/inotify.c
parent835f6b2c067f3105a330f1a4309eade3afc80ee6 (diff)
downloadlibguestfs-98869b86413ff59afa009f9d06ebc0cc4477ab31.tar.gz
libguestfs-98869b86413ff59afa009f9d06ebc0cc4477ab31.tar.xz
libguestfs-98869b86413ff59afa009f9d06ebc0cc4477ab31.zip
build: avoid warnings in daemon/inotify.c
Avoid "comparison between signed and unsigned integer expressions" warnings. If it's at all hard or risky to avoid this type of warning, then it's not worthwhile. Here, it's easy and safe. * daemon/inotify.c (inotify_posn): Declare local to be of unsigned type. (do_inotify_read, do_inotify_files): Likewise.
Diffstat (limited to 'daemon/inotify.c')
-rw-r--r--daemon/inotify.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/daemon/inotify.c b/daemon/inotify.c
index 1b90f2be..8bb8ed2b 100644
--- a/daemon/inotify.c
+++ b/daemon/inotify.c
@@ -33,7 +33,7 @@
static int inotify_fd = -1;
static char inotify_buf[64*1024*1024]; /* Event buffer, [0..posn-1] is valid */
-static int inotify_posn = 0;
+static size_t inotify_posn = 0;
/* Because inotify_init does NEED_ROOT, NEED_INOTIFY implies NEED_ROOT. */
#define NEED_INOTIFY(errcode) \
@@ -184,7 +184,8 @@ do_inotify_read (void)
while (space > 0) {
struct inotify_event *event;
- int n, r;
+ int r;
+ size_t n;
r = read (inotify_fd, inotify_buf + inotify_posn,
sizeof (inotify_buf) - inotify_posn);
@@ -274,7 +275,7 @@ do_inotify_files (void)
{
char **ret = NULL;
int size = 0, alloc = 0;
- int i;
+ unsigned int i;
FILE *fp;
guestfs_int_inotify_event_list *events;
char buf[PATH_MAX];