9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] quick question about proc.c:error(char *err)
@ 2002-08-26 23:28 Russ Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Russ Cox @ 2002-08-26 23:28 UTC (permalink / raw)
  To: 9fans

> void
> error(char *err)
> {
>         spllo();
>         kstrcpy(up->errstr, err, ERRMAX);
>         setlabel(&up->errlab[NERR-1]);
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>         nexterror();
> }

The setlabel is useful if you get an error stack
underflow or some other mismanagement error.
You can (sometimes) look at the label to reconstruct
the stack at the time that error was called.
It's for debugging only.

> What are the conditions when this label might be get used ?

Hopefully never.

> And what is expected from jumping into error ?

Error shouldn't return.  It should go to the innermost
waserror, returning non-zero.  Calling nexterror does this.

Russ


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [9fans] quick question about proc.c:error(char *err)
@ 2002-08-26  5:55 Roman V. Shaposhnick
  0 siblings, 0 replies; 2+ messages in thread
From: Roman V. Shaposhnick @ 2002-08-26  5:55 UTC (permalink / raw)
  To: 9fans

Can someone, please, give me any hint on why the underlined line of code
is needed in error():

void
error(char *err)
{
        spllo();
        kstrcpy(up->errstr, err, ERRMAX);
        setlabel(&up->errlab[NERR-1]);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        nexterror();
}

What are the conditions when this label might be get used ? And what is
expected from jumping into error ?

Thanks,
Roman.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-26 23:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-26 23:28 [9fans] quick question about proc.c:error(char *err) Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-08-26  5:55 Roman V. Shaposhnick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).