Do not strip out file when trying to update the mtime flag.

Part of #24
This commit is contained in:
Pascal Obry
2015-11-07 10:20:00 +01:00
parent a3c644fd74
commit 765d790b12
+3 -2
View File
@@ -362,9 +362,9 @@ static int cfs_open(const char *path, struct fuse_file_info *info)
else
{
temp_file = tmpfile();
if (!(info->flags & O_WRONLY))
if (!(info->flags & O_TRUNC))
{
if (!cloudfs_object_write_fp(path, temp_file))
if (!cloudfs_object_write_fp(path, temp_file) && !(info->flags & O_CREAT))
{
fclose(temp_file);
return -ENOENT;
@@ -382,6 +382,7 @@ static int cfs_open(const char *path, struct fuse_file_info *info)
of->flags = info->flags;
info->fh = (uintptr_t)of;
info->direct_io = 1;
info->nonseekable = 1;
return 0;
}