document-portal: Treat newly created files (EXCL) as truncated ones

The EXCL pretty much guarantees it is a new file.
This commit is contained in:
Alexander Larsson
2017-01-18 11:31:09 +01:00
parent 13b0c78fe5
commit 8909b5437d

View File

@@ -701,7 +701,7 @@ xdp_inode_create_file (XdpInode *dir,
inode->dir_fd = glnx_steal_fd (&dir_fd);
inode->fd = glnx_steal_fd (&fd);
inode->trunc_fd = glnx_steal_fd (&trunc_fd);
if (inode->trunc_fd != -1 && truncate)
if (inode->trunc_fd != -1 && (truncate || exclusive))
{
inode->truncated = TRUE;
g_free (inode->backing_filename);