Date: Thu, 23 Jan 2014 03:11:14 +0000
From: Taylor R Campbell <[email protected]>
Date: Wed, 22 Jan 2014 13:15:44 -0500
From: [email protected] (Christos Zoulas)
On Jan 22, 7:29am, [email protected] (Matt Thomas) wrote:
-- Subject: Re: CVS commit: src/share/mk
| I always wondered why we don't use ln -sf
| and avoid the race.
That does not work because if the destnation is a directory it will
try to link in the destination directory... (I tried). This is why
I suggested that it needs to be done differently.
ln -sfh?
As an aside, it would be nice if there were an easy way to create a
symlink at a temporary location and rename it over the permanent one.
`ln -sfh' will unlink instead, and mv(1) is too smart for its own good
about directories to be able to rename over a symlink reliably...
Disregard me -- `ln -sfh' is just as bad as the other race precisely
because of the unlink/symlink sequence, and `-h' is not POSIX to boot.
If we do add a TOOL_LN, we ought to implement a symlink-to-temporary
rename-to-permanent operation so that it actually doesn't race.