Il 23/06/2014 12:38, Alon Levy ha scritto:
>  {
> -    EmulatedState *card = opaque;
> +    EmulatedState *card = container_of(notifier, EmulatedState, notifier);
>      EmulEvent *event, *next;
> -    char dummy;
> -    int len;
>
> -    do {
> -        len = read(card->pipe[0], &dummy, sizeof(dummy));
> -    } while (len == sizeof(dummy));
> +    event_notifier_test_and_clear(&card->notifier);
Shouldn't the ignored return value be marked somehow?

It's a pretty common idiom to test-and-clear the event notifier. Really hot paths have a while() loop, but for ccid-card-emulated it's simpler to just go through the main loop again. In fact, it was just what the pipe-based code used to do. :)

Paolo


Reply via email to