Make safe_open with O_EXCL friendlier for NFS.
authorBrendan Cully <brendan@kublai.com>
Fri, 6 Apr 2007 19:54:46 +0000 (12:54 -0700)
committerBrendan Cully <brendan@kublai.com>
Fri, 6 Apr 2007 19:54:46 +0000 (12:54 -0700)
commitd086df8820f3f70333b42a66027458fb5e286712
treebc741c6bdc2dfd880e685a5601499ececc012c77
parentf5372058942d63b0432255dbdeaf0c808f3f431f
Make safe_open with O_EXCL friendlier for NFS.
Per #2707, when an open file is moved into a different directory over
NFS, it may leave a .nfsXXX hardlink behind. This causes the rmdir in
safe_open to fail, leaving tempdir droppings around. This patch works
around the problem by closing the file after creating it and reopening
it after rename.
lib.c