diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-17 14:28:53 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-17 14:28:53 +0000 |
commit | cb448fe01bbe75ef31c3190e8b63b0e1a320ffb4 (patch) | |
tree | 9757477193c1b8f3be9a772cabfb1ef92639240e /editors/patch.c | |
parent | ffae845cfd0a0b9872827d806984841d4cfee104 (diff) | |
download | busybox-w32-cb448fe01bbe75ef31c3190e8b63b0e1a320ffb4.tar.gz busybox-w32-cb448fe01bbe75ef31c3190e8b63b0e1a320ffb4.tar.bz2 busybox-w32-cb448fe01bbe75ef31c3190e8b63b0e1a320ffb4.zip |
libbb: introduce and use xrename and rename_or_warn.
Diffstat (limited to 'editors/patch.c')
-rw-r--r-- | editors/patch.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/editors/patch.c b/editors/patch.c index 07fa5cfaf..1b283a133 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -150,10 +150,7 @@ int patch_main(int argc, char **argv) | |||
150 | backup_filename = xmalloc(strlen(new_filename) + 6); | 150 | backup_filename = xmalloc(strlen(new_filename) + 6); |
151 | strcpy(backup_filename, new_filename); | 151 | strcpy(backup_filename, new_filename); |
152 | strcat(backup_filename, ".orig"); | 152 | strcat(backup_filename, ".orig"); |
153 | if (rename(new_filename, backup_filename) == -1) { | 153 | xrename(new_filename, backup_filename); |
154 | bb_perror_msg_and_die("cannot create file %s", | ||
155 | backup_filename); | ||
156 | } | ||
157 | dst_stream = xfopen(new_filename, "w"); | 154 | dst_stream = xfopen(new_filename, "w"); |
158 | } | 155 | } |
159 | 156 | ||