Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scord
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eu
ADMIRE
scord
Commits
31e77109
Verified
Commit
31e77109
authored
2 years ago
by
Alberto Miranda
Browse files
Options
Downloads
Patches
Plain Diff
Fix return for ADM_update_adhoc_storage()
parent
ccebb6b0
No related branches found
No related tags found
1 merge request
!66
Resolve "C++ API functions should not return error codes"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/cxx/ADM_update_adhoc_storage.cpp
+3
-10
3 additions, 10 deletions
examples/cxx/ADM_update_adhoc_storage.cpp
src/lib/admire.cpp
+8
-2
8 additions, 2 deletions
src/lib/admire.cpp
src/lib/admire.hpp
+1
-1
1 addition, 1 deletion
src/lib/admire.hpp
with
12 additions
and
13 deletions
examples/cxx/ADM_update_adhoc_storage.cpp
+
3
−
10
View file @
31e77109
...
...
@@ -63,22 +63,15 @@ main(int argc, char* argv[]) {
server
,
name
,
admire
::
storage
::
type
::
gekkofs
,
adhoc_storage_ctx
);
const
auto
ret
=
admire
::
update_adhoc_storage
(
server
,
adhoc_storage
,
new_adhoc_storage_ctx
);
if
(
!
ret
)
{
fmt
::
print
(
stderr
,
"FATAL: ADM_update_adhoc_storage() failed: {}
\n
"
,
ret
.
message
());
exit
(
EXIT_FAILURE
);
}
admire
::
update_adhoc_storage
(
server
,
adhoc_storage
,
new_adhoc_storage_ctx
);
fmt
::
print
(
stdout
,
"ADM_update_adhoc_storage() remote procedure completed "
"successfully
\n
"
);
exit
(
EXIT_SUCCESS
);
}
catch
(
const
std
::
exception
&
e
)
{
fmt
::
print
(
stderr
,
"FATAL: ADM_register_adhoc_storage() failed: {}
\n
"
,
e
.
what
());
fmt
::
print
(
stderr
,
"FATAL: example failed: {}
\n
"
,
e
.
what
());
exit
(
EXIT_FAILURE
);
}
}
This diff is collapsed.
Click to expand it.
src/lib/admire.cpp
+
8
−
2
View file @
31e77109
...
...
@@ -260,10 +260,16 @@ register_adhoc_storage(const server& srv, const std::string& name,
return
rv
.
value
();
}
admire
::
error_code
void
update_adhoc_storage
(
const
server
&
srv
,
const
adhoc_storage
&
adhoc_storage
,
const
adhoc_storage
::
ctx
&
adhoc_storage_ctx
)
{
return
detail
::
update_adhoc_storage
(
srv
,
adhoc_storage_ctx
,
adhoc_storage
);
const
auto
ec
=
detail
::
update_adhoc_storage
(
srv
,
adhoc_storage_ctx
,
adhoc_storage
);
if
(
!
ec
)
{
throw
std
::
runtime_error
(
fmt
::
format
(
"ADM_update_adhoc_storage() error: {}"
,
ec
.
message
()));
}
}
admire
::
error_code
...
...
This diff is collapsed.
Click to expand it.
src/lib/admire.hpp
+
1
−
1
View file @
31e77109
...
...
@@ -62,7 +62,7 @@ register_adhoc_storage(const server& srv, const std::string& name,
enum
adhoc_storage
::
type
type
,
const
adhoc_storage
::
ctx
&
ctx
);
admire
::
error_code
void
update_adhoc_storage
(
const
server
&
srv
,
const
adhoc_storage
&
adhoc_storage
,
const
adhoc_storage
::
ctx
&
adhoc_storage_ctx
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment