Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] persistent_save function being used in stable spells?

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Vladimír Marek <vlmarek AT volny.cz>
  • To: SM-Discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] persistent_save function being used in stable spells?
  • Date: Sun, 18 Apr 2004 10:37:07 +0200

> Hmm, also I had meant to point out that one of the reasons why sorcery is
> not detecting failures is due to structures like this:
> if [ -x BUILD ] ; then
> persistant_load
> . BUILD
> persistant_save
> else
> default_build
> fi &&

I can see another danger there, in the

persistant_load
. BUILD
persistant_save

itself. If the BUILD fails, persistant_save is going to carry out the
return also. There are two solutions I can see:

a)
persistant_load
. BUILD && persistant_save

b)
persistant_save will maintain return value from last function:
function persistant_save () {
local RET=$?

....

return $RET
}

Both solutions will work. But maybe a) is better, since if the spell
failed, then no values should be saved ?

I will add b) anyway, since that does not stop us from implementing a).
What do you think ?

--
Neuron




Archive powered by MHonArc 2.6.24.

Top of Page