mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 18:56:49 +01:00
FUSE compat: fall back to truncate if no ftruncate
* As defined by the FUSE interface: if the FUSE module doesn't implement ftruncate(), fall back to using truncate() instead
This commit is contained in:
parent
6297d6c73b
commit
1b4f5f9b94
@ -1474,6 +1474,10 @@ FUSEVolume::Open(void* _node, int openMode, void** _cookie)
|
||||
// truncate the file, if requested
|
||||
if (truncate) {
|
||||
fuseError = fuse_fs_ftruncate(fFS, path, 0, cookie);
|
||||
if (fuseError == ENOSYS) {
|
||||
// Fallback to truncate if ftruncate is not implemented
|
||||
fuseError = fuse_fs_truncate(fFS, path, 0);
|
||||
}
|
||||
if (fuseError != 0) {
|
||||
fuse_fs_flush(fFS, path, cookie);
|
||||
fuse_fs_release(fFS, path, cookie);
|
||||
|
Loading…
x
Reference in New Issue
Block a user