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:
parent
e3d0fe06bd
commit
06b8084b2c
@ -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;
|
struct stat st;
|
||||||
int fd, flags;
|
int fd, flags;
|
||||||
|
|
||||||
if (stat(path, &st)) {
|
if (stat(path, &st) || trunc) {
|
||||||
if (type == inode_file) {
|
if (type == inode_file) {
|
||||||
einfo("%s: creating file", path);
|
einfo("%s: creating file", path);
|
||||||
if (!mode) /* 664 */
|
if (!mode) /* 664 */
|
||||||
|
Loading…
Reference in New Issue
Block a user