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:
trasz 2018-08-09 11:46:12 +00:00
parent 5b5bf02859
commit 69ce84ba22

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;