X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Finotify.c;h=3e314f03b8f28faf0c44022feffd40a84d7f75ec;hb=627f89351d06e43564b47ea42cabaa522284c2a1;hp=1b90f2bed6ccb1bf7682ffbe3a873a0dd3bb02ae;hpb=1503652d07683b21c69a16f6e6f6af9aef84b839;p=libguestfs.git diff --git a/daemon/inotify.c b/daemon/inotify.c index 1b90f2b..3e314f0 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) \ @@ -51,7 +51,7 @@ do_inotify_init (int max_events) { FILE *fp; - NEED_ROOT (-1); + NEED_ROOT (return -1); if (max_events < 0) { reply_with_error ("inotify_init: max_events < 0"); @@ -123,13 +123,12 @@ do_inotify_close (void) } int64_t -do_inotify_add_watch (char *path, int mask) +do_inotify_add_watch (const char *path, int mask) { int64_t r; char *buf; NEED_INOTIFY (-1); - ABS_PATH (path, -1); buf = sysroot_path (path); if (!buf) { @@ -184,7 +183,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 +274,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];