mirror of
https://github.com/vgough/encfs.git
synced 2025-02-18 02:31:00 +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);
|
int res = fnode->open(O_RDONLY);
|
||||||
if (res >= 0) {
|
if (res >= 0) {
|
||||||
int fh = res;
|
int fh = res;
|
||||||
res = close(dup(fh));
|
int nfh = dup(fh);
|
||||||
if (res == -1) res = -errno;
|
if (nfh == -1) {
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
|
res = close(nfh);
|
||||||
|
if (res == -1) {
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
Loading…
Reference in New Issue
Block a user