On Jun 12, 2015 7:54 AM, "Ian Kelly" <ian.g.ke...@gmail.com> wrote:
>
> On Jun 12, 2015 7:21 AM, "Grawburg" <grawb...@myglnc.com> wrote:
> >
> > I have a piece of code written for a Raspberry Pi with no explanation
for two of the lines -- and I can't find an explanation I understand.
> >
> > Here are the lines:
> > if os.system('modprobe --first-time -q w1_gpio') ==0
> >
> > if os.system('modprobe -q w1_gpio') == 256:
> >
> >
> >
> > I know what the 'modprobe...' is, it's the 0 and the 256 I don't get.
Where do these numbers come from?
> > I recognize they're some kind of error returns, but don't know what
they mean.
>
> Exit code 0 traditionally means success. The exit status is two bytes,
with the low-order byte normally containing the exit code and the
high-order byte containing the signal that caused the program to exit. So
256 would appear to mean that modprobe exited due to SIGHUP, although that
seems an odd thing to test for here so I may be wrong.

Per the last two posters I have it backward, which explains my confusion.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to