From b61259dc79452e0a110e48cc8ea0cbdee3d229dd Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 11 Nov 2016 11:00:30 +0100 Subject: [PATCH] document-portal: Fix file trucation We were checking the error return in the wrong way. --- document-portal/xdp-fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);