Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2016 18:19:08 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303931 - head/usr.bin/xinstall
Message-ID:  <201608101819.u7AIJ8TT079448@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Wed Aug 10 18:19:08 2016
New Revision: 303931
URL: https://svnweb.freebsd.org/changeset/base/303931

Log:
  Fix -S with -l not being atomic.
  
  It was unlinking the target even though it uses rename(2) which already
  effectively does that.  -S is intended to not unlink(2) the target first.
  
  MFC after:	1 week
  Reviewed by:	jhb
  Sponsored by:	EMC / Isilon Storage Division
  Differential Revision:	https://reviews.freebsd.org/D7452

Modified:
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/xinstall.c
==============================================================================
--- head/usr.bin/xinstall/xinstall.c	Wed Aug 10 18:19:05 2016	(r303930)
+++ head/usr.bin/xinstall/xinstall.c	Wed Aug 10 18:19:08 2016	(r303931)
@@ -536,7 +536,6 @@ do_link(const char *from_name, const cha
 			if (verbose)
 				printf("install: link %s -> %s\n",
 				    from_name, to_name);
-			unlink(to_name);
 			ret = rename(tmpl, to_name);
 			/*
 			 * If rename has posix semantics, then the temporary
@@ -580,8 +579,6 @@ do_symlink(const char *from_name, const 
 		if (target_sb->st_flags & NOCHANGEBITS)
 			(void)chflags(to_name, target_sb->st_flags &
 			     ~NOCHANGEBITS);
-		unlink(to_name);
-
 		if (verbose)
 			printf("install: symlink %s -> %s\n",
 			    from_name, to_name);



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