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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
24da710f
Commit
24da710f
authored
Jan 14, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8f706761
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
wcfs/internal/wcfs.cpp
wcfs/internal/wcfs.cpp
+6
-1
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+31
-0
wcfs/internal/wcfs_watchlink.cpp
wcfs/internal/wcfs_watchlink.cpp
+0
-8
No files found.
wcfs/internal/wcfs.cpp
View file @
24da710f
...
...
@@ -111,7 +111,7 @@ error _Conn::close() {
// XXX errctx "close conn @%s", wconn.at
// XXX + conn # e.g. from wconn._wlink.id? or wlink.close should include its id itself?
error
err
,
eret
;
auto
reterr1
=
[
&
eret
](
const
error
&
err
)
{
auto
reterr1
=
[
&
eret
](
error
err
)
{
if
(
eret
==
nil
&&
err
!=
nil
)
eret
=
err
;
};
...
...
@@ -144,6 +144,11 @@ error _Conn::close() {
}
wconn
.
_filehtab
.
clear
();
// XXX -> try to top
if
(
eret
!=
nil
)
eret
=
fmt
::
errorf
(
"close conn @%s: %s"
,
h_
(
wconn
.
at
),
v
(
eret
));
return
eret
;
}
...
...
wcfs/internal/wcfs_misc.h
View file @
24da710f
...
...
@@ -156,6 +156,37 @@ namespace wcfs {
// TidHead is invalid Tid which is largest Tid value and means @head.
const
zodb
::
Tid
TidHead
=
-
1ULL
;
// v mimics %v for T to be used in printf & friends.
//
// NOTE returned char* pointer is guaranteed to stay valid till end of current expression.
// e.g.
//
// printf("hello %s", v(obj))
//
// is valid, while
//
// x = v(obj);
// use(x);
//
// is not valid.
#define v(obj) (v_(obj).c_str())
template
<
typename
T
>
string
v_
(
T
obj
)
{
return
obj
.
String
();
}
template
<
>
inline
string
v_
(
error
err
)
{
return
(
err
!=
nil
)
?
err
->
Error
()
:
"nil"
;
}
#if 0
const char *v(error err) {
if (err != nil)
return err->Error().c_str(); // XXX Error() gives temp. obj
return "nil";
}
#endif
}
// wcfs::
#endif
wcfs/internal/wcfs_watchlink.cpp
View file @
24da710f
...
...
@@ -30,14 +30,6 @@
namespace
wcfs
{
// v mimics %v for error
// XXX temp, place, ok=?
const
char
*
v
(
error
err
)
{
if
(
err
!=
nil
)
return
err
->
Error
().
c_str
();
// XXX Error() gives temp. obj
return
"nil"
;
}
_WatchLink
::
_WatchLink
()
{}
_WatchLink
::~
_WatchLink
()
{}
void
_WatchLink
::
decref
()
{
...
...
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