X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Finotify.c;h=2f22f52c8b646ec3fa2542e094e0048ab07ffa30;hb=0dd6c8c8442d4ff588f6dac2efab24d3409b0dec;hp=1b90f2bed6ccb1bf7682ffbe3a873a0dd3bb02ae;hpb=1503652d07683b21c69a16f6e6f6af9aef84b839;p=libguestfs.git diff --git a/daemon/inotify.c b/daemon/inotify.c index 1b90f2b..2f22f52 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) \ @@ -129,7 +129,7 @@ do_inotify_add_watch (char *path, int mask) char *buf; NEED_INOTIFY (-1); - ABS_PATH (path, -1); + ABS_PATH (path, return -1); buf = sysroot_path (path); if (!buf) { @@ -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];