static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)

{

    struct dirent *entry;

    DIR *dir;



    if (o->have_children) {

        return;

    }

    o->have_children = true;



    dir = opendir(o->path);

    if (!dir) {

        return;

    }

#ifdef __linux__

    int watchfd = usb_mtp_add_watch(s->inotifyfd, o->path);

    if (watchfd == -1) {

        fprintf(stderr, "usb-mtp: failed to add watch for %s\n", o->path);

    } else {

        trace_usb_mtp_inotify_event(s->dev.addr, o->path,

                                    0, "Watch Added");

        o->watchfd = watchfd;

    }

#endif

    while ((entry = readdir(dir)) != NULL) {

        usb_mtp_add_child(s, o, entry->d_name);

    }

    closedir(dir);

}

static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)

{

    struct dirent *entry;

    DIR *dir;



    if (o->have_children) {

        return;

    }

    o->have_children = true;



    dir = opendir(o->path);

    if (!dir) {

        return;

    }

#ifdef __linux__

    int watchfd = usb_mtp_add_watch(s->inotifyfd, o->path);

    if (watchfd == -1) {

        fprintf(stderr, "usb-mtp: failed to add watch for %s\n", o->path);

    } else {

        trace_usb_mtp_inotify_event(s->dev.addr, o->path,

                                    0, "Watch Added");

        o->watchfd = watchfd;

    }

#endif

    while ((entry = readdir(dir)) != NULL) {

        usb_mtp_add_child(s, o, entry->d_name);

    }

    closedir(dir);

}

#ifdef __linux__ #ifdef __linux__ #ifdef __linux__ #ifdef __linux__ #ifdef __linux__ #ifdef __linux__ #ifdef __linux__ #ifdef __linux__ #ifdef __linux__ #ifdef __linux__
static void FUNC_0(MTPState *VAR_0, MTPObject *VAR_1)

{

    struct dirent *VAR_2;

    DIR *dir;



    if (VAR_1->have_children) {

        return;

    }

    VAR_1->have_children = true;



    dir = opendir(VAR_1->path);

    if (!dir) {

        return;

    }

#ifdef __linux__

    int watchfd = usb_mtp_add_watch(VAR_0->inotifyfd, VAR_1->path);

    if (watchfd == -1) {

        fprintf(stderr, "usb-mtp: failed to add watch for %VAR_0\n", VAR_1->path);

    } else {

        trace_usb_mtp_inotify_event(VAR_0->dev.addr, VAR_1->path,

                                    0, "Watch Added");

        VAR_1->watchfd = watchfd;

    }

#endif

    while ((VAR_2 = readdir(dir)) != NULL) {

        usb_mtp_add_child(VAR_0, VAR_1, VAR_2->d_name);

    }

    closedir(dir);

}

static void FUNC_0(MTPState *VAR_0, MTPObject *VAR_1)
{ struct dirent *VAR_2; DIR *dir; if (VAR_1->have_children) { return; } VAR_1->have_children = true; dir = opendir(VAR_1->path); if (!dir) { return; } #ifdef __linux__
int watchfd = usb_mtp_add_watch(VAR_0->inotifyfd, VAR_1->path); if (watchfd == -1) { fprintf(stderr, "usb-mtp: failed to add watch for %VAR_0\n", VAR_1->path); } else { trace_usb_mtp_inotify_event(VAR_0->dev.addr, VAR_1->path,
0, "Watch Added"); VAR_1->watchfd = watchfd; } #endif
while ((VAR_2 = readdir(dir)) != NULL) { usb_mtp_add_child(VAR_0, VAR_1, VAR_2->d_name); } closedir(dir); }