From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zypyy-0000yI-Ss for qemu-devel@nongnu.org; Tue, 17 Nov 2015 18:48:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zypyv-00032v-Nq for qemu-devel@nongnu.org; Tue, 17 Nov 2015 18:48:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zypyv-00032p-I5 for qemu-devel@nongnu.org; Tue, 17 Nov 2015 18:48:13 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id D2081C100449 for ; Tue, 17 Nov 2015 23:48:12 +0000 (UTC) From: Bandan Das References: <1447718794-19812-1-git-send-email-bsd@redhat.com> <1447718794-19812-4-git-send-email-bsd@redhat.com> <1447761819.23726.74.camel@redhat.com> Date: Tue, 17 Nov 2015 18:48:11 -0500 In-Reply-To: <1447761819.23726.74.camel@redhat.com> (Gerd Hoffmann's message of "Tue, 17 Nov 2015 13:03:39 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3 3/4] usb-mtp: Add support for inotify based file monitoring List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann writes: > Hi, > >> +#ifndef __linux__ >> + return 1; >> +#endif > > Hmm? Shouldn't the stubs avoid these kinds of #ifdefs? > >> - QLIST_FOREACH(iter, &o->children, list) { >> + QLIST_FOREACH_SAFE(iter, &o->children, list, next) { >> handles[i++] = iter->handle; >> } > > No need for SAFE here, you don't change the list. Isn't the SAFE variant better for the case where a inotify delete event occurs when we are getting the object handles ? >> + if (usb_mtp_inotify_init(s)) { >> + fprintf(stderr, "usb-mtp: file monitoring init failed\n"); >> + } > > I guess we want a function/macro here for linux/non-linux, then report > errors on linux only. Reporting inotify failures on systems which don't > support inotify in the first place is just noise ... Agreed, I will rewrite this part. > cheers, > Gerd