aboutsummaryrefslogtreecommitdiff
path: root/lib/xwrap.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-12-14 21:22:10 -0600
committerRob Landley <rob@landley.net>2018-12-14 21:22:10 -0600
commitc2a44fbe073fb13ab9407ac3a072c7b847383b62 (patch)
treeb819f38f764fad30ee6ae1182d8bc054471f9f08 /lib/xwrap.c
parentd4017dbd0a422953bc439db467db9c36d5dd4e33 (diff)
downloadtoybox-c2a44fbe073fb13ab9407ac3a072c7b847383b62.tar.gz
Add xrename()
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r--lib/xwrap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 2027069d..b2416a4e 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -378,6 +378,11 @@ int notstdio(int fd)
return fd;
}
+void xrename(char *from, char *to)
+{
+ if (rename(from, to)) perror_exit("rename %s -> %s", from, to);
+}
+
int xtempfile(char *name, char **tempname)
{
int fd;