int qemu_add_child_watch(pid_t pid)

{

    ChildProcessRecord *rec;



    if (!sigchld_bh) {

        qemu_init_child_watch();

    }



    QLIST_FOREACH(rec, &child_watches, next) {

        if (rec->pid == pid) {

            return 1;

        }

    }

    rec = g_malloc0(sizeof(ChildProcessRecord));

    rec->pid = pid;

    QLIST_INSERT_HEAD(&child_watches, rec, next);

    return 0;

}

int qemu_add_child_watch(pid_t pid)

{

    ChildProcessRecord *rec;



    if (!sigchld_bh) {

        qemu_init_child_watch();

    }



    QLIST_FOREACH(rec, &child_watches, next) {

        if (rec->pid == pid) {

            return 1;

        }

    }

    rec = g_malloc0(sizeof(ChildProcessRecord));

    rec->pid = pid;

    QLIST_INSERT_HEAD(&child_watches, rec, next);

    return 0;

}

int FUNC_0(pid_t VAR_0)

{

    ChildProcessRecord *rec;



    if (!sigchld_bh) {

        qemu_init_child_watch();

    }



    QLIST_FOREACH(rec, &child_watches, next) {

        if (rec->VAR_0 == VAR_0) {

            return 1;

        }

    }

    rec = g_malloc0(sizeof(ChildProcessRecord));

    rec->VAR_0 = VAR_0;

    QLIST_INSERT_HEAD(&child_watches, rec, next);

    return 0;

}

int FUNC_0(pid_t VAR_0)
{ ChildProcessRecord *rec; if (!sigchld_bh) { qemu_init_child_watch(); } QLIST_FOREACH(rec, &child_watches, next) { if (rec->VAR_0 == VAR_0) { return 1; } } rec = g_malloc0(sizeof(ChildProcessRecord)); rec->VAR_0 = VAR_0; QLIST_INSERT_HEAD(&child_watches, rec, next); return 0; }