Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!orcenl!bengsig From: bengsig@oracle.nl (Bjorn Engsig) Newsgroups: gnu.bash.bug Subject: Re: question about nojobs.c, bash-1.04 Message-ID: <1022.nlhp3@oracle.nl> Date: 13 Feb 90 13:18:35 GMT References: <7551@tank.uchicago.edu> Reply-To: bengsig@oracle.nl (Bjorn Engsig) Organization: ORACLE Europe, The Netherlands Lines: 18 Article <7551@tank.uchicago.edu> by goer@sophist.UUCP (Richard Goerwitz) says: | struct { /* clever way of getting at | unsigned char low; * wait's high and low | } * / | bytes; |#define w_termsig bytes.low & 0x7f /* mask out eighth bit */ | status.w_termsig = status.w_retcode = 0; /* <-- NOTE */ | |[...] w_termsig expands to bytes.low & 0x7f [and the] expression expands to | | status.bytes.low & 0x7f = status.w_retcode = 0; In many systsem, a system header file will define the struct with bitfields named termsig, etc. but the bash implementors define these as masks to help those without the right header file. They then just this incorrectly, and you should use the masking status.bytes.low &= 0x80 as you suggest. -- Bjorn Engsig, Domain: bengsig@oracle.nl, bengsig@oracle.com Path: uunet!{mcsun!orcenl,oracle}!bengsig