summaryrefslogtreecommitdiff
path: root/os-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'os-posix.c')
-rw-r--r--os-posix.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/os-posix.c b/os-posix.c
index 38e21cf..ca950b1 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -116,6 +116,10 @@ int os_get_cwd(char *buf, size_t buflen) {
}
}
+int os_rename_overwrite(const char *oldname, const char *newname) {
+ return rename(oldname, newname) == 0 ? 0 : -1;
+}
+
struct timespec time_last_modified(const char *filename) {
struct stat statbuf = {0};
stat(filename, &statbuf);