diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; +} |