summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 7fb6b05..271f79f 100644
--- a/src/util.c
+++ b/src/util.c
@@ -437,7 +437,7 @@ move_file (char const *from, bool *from_needs_removal,
struct stat to_st;
int to_errno;
- to_errno = lstat (to, &to_st) == 0 ? 0 : errno;
+ to_errno = stat_file (to, &to_st);
if (backup)
create_backup (to, to_errno ? NULL : &to_st, false);
if (! to_errno)
@@ -1649,3 +1649,8 @@ make_tempfile (char const **name, char letter, char const *real_name,
return fd;
}
}
+
+int stat_file (char const *filename, struct stat *st)
+{
+ return lstat (filename, st) == 0 ? 0 : errno;
+}