diff --git a/document-portal/xdp-fuse.c b/document-portal/xdp-fuse.c index 075a2b1d..963be7fd 100644 --- a/document-portal/xdp-fuse.c +++ b/document-portal/xdp-fuse.c @@ -1744,7 +1744,7 @@ truncateat (int dir_fd, const char *filename, int size) int errsv, res; fd = openat (dir_fd, filename, O_RDWR); - if (fd != -1) + if (fd == -1) return -1; res = ftruncate (fd, size);