Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177591460
D7451.1794808835.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
698 B
Referenced Files
None
Subscribers
None
D7451.1794808835.diff
View Options
Index: usr.bin/xinstall/xinstall.c
===================================================================
--- usr.bin/xinstall/xinstall.c
+++ usr.bin/xinstall/xinstall.c
@@ -892,11 +892,17 @@
}
if (verbose)
(void)printf("install: %s -> %s\n", to_name, backup);
- if (rename(to_name, backup) < 0) {
+ if (unlink(backup) < 0 && errno != ENOENT) {
serrno = errno;
unlink(tempfile);
errno = serrno;
- err(EX_OSERR, "rename: %s to %s", to_name,
+ err(EX_OSERR, "unlink: %s", backup);
+ }
+ if (link(to_name, backup) < 0) {
+ serrno = errno;
+ unlink(tempfile);
+ errno = serrno;
+ err(EX_OSERR, "link: %s to %s", to_name,
backup);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 6:00 AM (19 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41763528
Default Alt Text
D7451.1794808835.diff (698 B)
Attached To
Mode
D7451: Fix combination of -S and -b not atomically updating the destination file.
Attached
Detach File
Event Timeline