Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161197092
D7451.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
713 B
Referenced Files
None
Subscribers
None
D7451.diff
View Options
Index: head/usr.bin/xinstall/xinstall.c
===================================================================
--- head/usr.bin/xinstall/xinstall.c
+++ head/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
Thu, Jul 2, 12:42 PM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34576937
Default Alt Text
D7451.diff (713 B)
Attached To
Mode
D7451: Fix combination of -S and -b not atomically updating the destination file.
Attached
Detach File
Event Timeline
Log In to Comment