svn commit: r337530 - head/sbin/ldconfig
Edward Tomasz Napierala
trasz at FreeBSD.org
Thu Aug 9 11:46:14 UTC 2018
Author: trasz
Date: Thu Aug 9 11:46:12 2018
New Revision: 337530
URL: https://svnweb.freebsd.org/changeset/base/337530
Log:
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
Modified:
head/sbin/ldconfig/ldconfig.c
Modified: head/sbin/ldconfig/ldconfig.c
==============================================================================
--- head/sbin/ldconfig/ldconfig.c Thu Aug 9 11:30:13 2018 (r337529)
+++ head/sbin/ldconfig/ldconfig.c Thu Aug 9 11:46:12 2018 (r337530)
@@ -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;
More information about the svn-src-all
mailing list