Subject: Re: sparc: sh dumps core
To: None <port-sparc@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 10/15/1997 11:38:20
> Christos's change to bin/sh/jobs.c (1.23 1997/10/08 20:31:52) breaks
> on sparc.

> He changed line 782 from
> 	else if ((sp->status & 0377) == 0177)
> to
> 	else if (WIFSTOPPED(sp->status))

Which is, in general, proper, except that sp->status isn't the correct
type.  WIFSTOPPED takes a status such as is returned by wait, and wait
takes an "int *".  In waitcmd() is an example of how to do this right,
or at least less wrong: assign the status field to an int before
passing it to WIFSTOPPED.

However, the wait manpage does not give any reason to think that taking
the status and shoving it into a short won't lose information.  I'd say
the right thing to do is to re-type the status field as an int.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B