Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Aug 2018 11:46:13 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337530 - head/sbin/ldconfig
Message-ID:  <201808091146.w79BkDFq080777@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808091146.w79BkDFq080777>