freebsd-skq/usr.bin/sed
Jilles Tjoelker 919e14f01e sed: Try hard links to make -i target available continually.
When creating a backup file, sed renamed the original before renaming the
changed copy into place, leading to a short time when no file with the
original name was present (usually only visible on SMP systems). Try
creating the backup file using a hard link instead, avoiding this problem.
If creating the hard link fails for any reason, fall back to the old rename
method.

When not creating a backup file, sed already renamed the changed copy onto
the original. This remains unchanged.

I am not adding the suppression of redundant fchown/fchmod to this commit,
because FreeBSD appears to check this in the kernel (for msdosfs at least).

PR:		bin/153261
Submitted by:	Pedro F. Giffuni
Reviewed by:	dds (older version)
Obtained from:	Illumos
MFC after:	2 weeks
2011-01-08 00:03:18 +00:00
..
compile.c IEEE Std 1003.1, 2004 Edition states: 2009-09-20 15:47:31 +00:00
defs.h Implement "addr1,+N" ranges - not dissimilar to grep's -A switch. 2009-05-25 06:45:33 +00:00
extern.h
main.c sed: Try hard links to make -i target available continually. 2011-01-08 00:03:18 +00:00
Makefile Build usr.bin/ with WARNS=6 by default. 2010-01-02 10:27:05 +00:00
misc.c Revert most part of 200420 as requested, as more review and polish is 2009-12-13 03:14:06 +00:00
POSIX
process.c Implement "addr1,+N" ranges - not dissimilar to grep's -A switch. 2009-05-25 06:45:33 +00:00
sed.1 Make -r mean exactly the same thing as -E for increased compatibility 2010-03-31 17:40:13 +00:00