|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH v4] tools/lsevtchn: Use errno macro to handle hypercall error cases
On Mon, Jul 29, 2024 at 09:58:46AM +0200, Jan Beulich wrote:
> 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?
There's no particular reason why three "goto out"s were used.
I will tweak these style decisions in patch v5.
Matt
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |