Vincent Lefevre wrote in <20180821230229.ga16...@zira.vinc17.org>:
 |On 2018-08-21 07:07:15 -0700, Kevin J. McCarthy wrote:
 |> I don't like removing 20-year old safety checks, but I think it's okay
 |> to do so for the case where link() returns 0.
 |
 |I was also hesitant, but after thinking more about it:
 |
 |* That's an unusual "safety check" (I doubt other software does
 |  the same kind of check after link() with return value 0).

Quite the opposite is true.  The original BSD code for creating
dotlock files does this, always.

 |* It is not clear whether this has ever been usuful (nothing in
 |  comment or in the commit log).

According to some statement on a list you are also subscribed to
this NFS problem has been fixed "at the early 90s".  The BSD code
i refer to came up later as far as i now (without having digged to
thoroughly).

 |* It might even have been a mistake. I suspect that the goal was
 |  for NFS, but then the test should have been for non-zero return
 |  values instead of zero.

The code i refer to was not about renaming some file, but about
savely creating a temporary dotlock file, of course, where several
processes may create the very same file, and it must be ensured
that it is you who won the race.  Since i have no overview over
Unix systems but *BSD and Linux (2.0.x, 2.2.x, 2.4.x, then
a decade not, then 4.x), and Solaris via OpenCSW.org, and an old
UnixWare VM but which i have not used since my old machine died,
i would not dare to change this.  Maybe Christos Zoulas of NetBSD
would know more, but then i think i am not the right one to ask.

I for one will not change the code for the MUA i maintain, because
one of the (very far) future goals is (at least partial) support
of elder Unix from before Y2K (from before 1999-01-11, when
i first used Linux, to be exact).

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply via email to