Gerd Hoffmann <kra...@redhat.com> 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