Make ldconfig(8) atomic, by removing an unneccessary call to unlink(2)

before rename(2).

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D16641
This commit is contained in:
Edward Tomasz Napierala 2018-08-09 11:46:12 +00:00
parent 25a1e0f636
commit 308224833a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337530

View File

@ -518,13 +518,6 @@ buildhints(void)
warn("%s", hints_file);
return -1;
}
/* Install it */
if (unlink(hints_file) != 0 && errno != ENOENT) {
warn("%s", hints_file);
return -1;
}
if (rename(tmpfilename, hints_file) != 0) {
warn("%s", hints_file);
return -1;