hw/usb: don't set IN_ISDIR for inotify watch in MTP driver
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 11 Jun 2018 16:41:59 +0000 (17:41 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 26 Feb 2019 15:25:58 +0000 (15:25 +0000)
IN_ISDIR is not a bit that one can request when registering a
watch with inotify_add_watch. Rather it is a bit that is set
automatically when reading events from the kernel.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
hw/usb/dev-mtp.c

index f1d20fa1b9830e2370d4412723c3e4bbed0664eb..f0c52a476a1aaa2ab7d83fdb413997d9e5813745 100644 (file)
@@ -653,8 +653,7 @@ static void usb_mtp_inotify_cleanup(MTPState *s)
 
 static int usb_mtp_add_watch(int inotifyfd, char *path)
 {
-    uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY |
-        IN_ISDIR;
+    uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY;
 
     return inotify_add_watch(inotifyfd, path, mask);
 }