document-portal: Fix file trucation

We were checking the error return in the wrong way.
This commit is contained in:
Alexander Larsson
2016-11-11 11:00:30 +01:00
parent e175774d35
commit b61259dc79

View File

@@ -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);