Ensure that when -F is passed, existing files are truncated properly.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Robin H. Johnson 2012-01-23 05:30:00 +00:00
parent e3d0fe06bd
commit 06b8084b2c

View File

@ -61,7 +61,7 @@ do_check(char *path, uid_t uid, gid_t gid, mode_t mode, inode_t type, bool trunc
struct stat st;
int fd, flags;
if (stat(path, &st)) {
if (stat(path, &st) || trunc) {
if (type == inode_file) {
einfo("%s: creating file", path);
if (!mode) /* 664 */