mirror of
https://github.com/vgough/encfs.git
synced 2024-11-25 09:23:13 +01:00
improve error handling in flush operation
This commit is contained in:
parent
eaf2574d03
commit
d99c2e2df2
@ -564,8 +564,14 @@ int _do_flush(FileNode *fnode) {
|
||||
int res = fnode->open(O_RDONLY);
|
||||
if (res >= 0) {
|
||||
int fh = res;
|
||||
res = close(dup(fh));
|
||||
if (res == -1) res = -errno;
|
||||
int nfh = dup(fh);
|
||||
if (nfh == -1) {
|
||||
return -errno;
|
||||
}
|
||||
res = close(nfh);
|
||||
if (res == -1) {
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user