help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions about signal handling in GNU Make


From: Kaz Kylheku (gmake)
Subject: Re: Questions about signal handling in GNU Make
Date: Sat, 24 Jul 2021 07:57:54 -0700
User-agent: Roundcube Webmail/0.9.2

On 2021-07-24 06:21, Masahiro Yamada wrote:
To avoid the race on the tool side, as you mentioned,
we can write to a tmpfile, and rename it as a last step.

But, no we can't!

This situation is not a problem only in the case when
the recipe has one step to perform.

What if it is like this?

   out: in
       step1 in out
       step2 out

step1 performs the temporary rename dance to atomically
create "out", while make is handling the interrupt again.

make doesn't see "out" so doesn't remove anything, but
then moments later, step1 executes a rename of a temporary
file to "out" before terminating.

Now there is a half-baked but up-to-date out, because
step2 wasn't executed.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]