Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
70803cff
Commit
70803cff
authored
Feb 13, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7355cffc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+9
-3
No files found.
wcfs/client/wcfs.cpp
View file @
70803cff
...
@@ -322,13 +322,19 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
...
@@ -322,13 +322,19 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
if
(
err
!=
nil
)
if
(
err
!=
nil
)
return
make_pair
(
nil
,
E
(
err
));
return
make_pair
(
nil
,
E
(
err
));
bool
allok
=
false
;
defer
([
&
]()
{
if
(
!
allok
)
f
->
_headf
->
close
();
});
struct
stat
st
;
struct
stat
st
;
err
=
f
->
_headf
->
stat
(
&
st
);
err
=
f
->
_headf
->
stat
(
&
st
);
if
(
err
!=
nil
)
if
(
err
!=
nil
)
return
make_pair
(
nil
,
E
(
err
));
// XXX close headf
return
make_pair
(
nil
,
E
(
err
));
f
->
blksize
=
st
.
st_blksize
;
f
->
blksize
=
st
.
st_blksize
;
f
->
_headfsize
=
st
.
st_size
;
f
->
_headfsize
=
st
.
st_size
;
if
(
!
(
f
->
_headfsize
%
f
->
blksize
==
0
))
// XXX close headf
if
(
!
(
f
->
_headfsize
%
f
->
blksize
==
0
))
return
make_pair
(
nil
,
E
(
fmt
::
errorf
(
"wcfs bug: head/file size %% blksize != 0"
)));
return
make_pair
(
nil
,
E
(
fmt
::
errorf
(
"wcfs bug: head/file size %% blksize != 0"
)));
wconn
.
_filehtab
[
foid
]
=
f
;
wconn
.
_filehtab
[
foid
]
=
f
;
...
@@ -340,10 +346,10 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
...
@@ -340,10 +346,10 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
return
make_pair
(
nil
,
E
(
err
));
return
make_pair
(
nil
,
E
(
err
));
if
(
ack
!=
"ok"
)
{
if
(
ack
!=
"ok"
)
{
// XXX unregister f from _filehtab
// XXX unregister f from _filehtab
// XXX close headf
return
make_pair
(
nil
,
fmt
::
errorf
(
"watch: %s"
,
v
(
ack
)));
return
make_pair
(
nil
,
fmt
::
errorf
(
"watch: %s"
,
v
(
ack
)));
}
}
allok
=
true
;
return
make_pair
(
f
,
nil
);
return
make_pair
(
f
,
nil
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment