Automated submission of kernel panic reports

Eitan Adler lists at eitanadler.com
Mon Nov 4 03:14:17 UTC 2013


On Sun, Nov 3, 2013 at 9:59 PM, Colin Percival <cperciva at freebsd.org> wrote:
> On 11/03/13 13:29, Jilles Tjoelker wrote:
>> Some remarks about panicmail:
>>
>>> local tmpfile=`mktemp` || exit 1
>>
>> This kind of thing does not do what you expect. The 'local' utility
>> returns 0 because it successfully created the local variable, ignoring
>> the status from the command substitution. Use
>>   local tmpfile
>>   tmpfile=`mktemp` || exit 1
>> in both occurrences.
>
> Wow, I had no idea.  I guess it never occurred to me that 'local' would
> even *have* an exit status...

It can even exit non-zero:
$ foo() { readonly bar; local bar="f"; echo $?; }; foo;
local: bar: is read only
2



-- 
Eitan Adler


More information about the freebsd-hackers mailing list