On 26.07.2024 18:40, Matthew Barnes wrote:
> @@ -24,7 +25,23 @@ int main(int argc, char **argv)
>          status.port = port;
>          rc = xc_evtchn_status(xch, &status);
>          if ( rc < 0 )
> -            break;
> +        {
> +            switch ( errno ) {
> +                case EACCES: continue; /* Xen-owned evtchn */
> +                case EINVAL: /* Port enumeration has ended */
> +                    rc = 0;
> +                    goto out;
> +
> +                case ESRCH:
> +                    perror("Domain ID does not correspond to valid domain");
> +                    rc = ESRCH;
> +                    goto out;
> +                default:
> +                    perror(NULL);
> +                    rc = errno;
> +                    goto out;
> +            }
> +        }

There are a number of style violations here: Opening figure brace
placement, indentation of the case labels, placement of the
"continue", lack of blank lines between non-fall-through case blocks.
Also why three "goto out" when one would do?

Jan

Reply via email to