Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
bake
Commits
b3f14e00
Commit
b3f14e00
authored
Jan 29, 2021
by
Philip Carns
Browse files
return ENOENT if trying to attach missing target
parent
252b566c
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/bake-server.h
View file @
b3f14e00
...
...
@@ -55,16 +55,14 @@ int bake_provider_register(margo_instance_id mid,
int
bake_provider_deregister
(
bake_provider_t
provider
);
/**
* Makes the provider start managing a target.
* The target must have been previously created with bake_makepool,
* and it should not be managed by another provider (whether in this
* proccess or another).
* Makes the provider start managing a target. The target must have already
* been created in the past.
*
* @param provider Bake provider
* @param target_name path to pmem target
* @param target_id resulting id identifying the target
*
* @return
0 on success, -1 on failure
* @return
BAKE_SUCCESS or BAKE_ERR*
*/
int
bake_provider_attach_target
(
bake_provider_t
provider
,
const
char
*
target_name
,
...
...
include/bake.h
View file @
b3f14e00
...
...
@@ -55,7 +55,9 @@ typedef struct {
#define BAKE_ERR_FORBIDDEN (-12)
/* Forbidden operation */
#define BAKE_ERR_BACKEND_TYPE (-13)
/* Unknown backend type */
#define BAKE_ERR_IO (-14)
/* Back-end I/O error */
#define BAKE_ERR_END (-15)
/* End of valid bake error codes */
#define BAKE_ERR_NOENT (-15)
/* entry does not exist */
#define BAKE_ERR_EXIST (-16)
/* entry already exists */
#define BAKE_ERR_END (-17)
/* End of valid bake error codes */
/**
* Print bake errors in human-friendly form
...
...
src/bake-file-backend.c
View file @
b3f14e00
...
...
@@ -215,7 +215,7 @@ static int bake_file_backend_initialize(bake_provider_t provider,
if
(
new_entry
->
log_fd
<
0
)
{
BAKE_ERROR
(
provider
->
mid
,
"open(): %s on %s"
,
strerror
(
-
new_entry
->
log_fd
),
path
);
ret
=
BAKE_ERR_
IO
;
ret
=
BAKE_ERR_
NOENT
;
goto
error_cleanup
;
}
...
...
src/bake-pmem-backend.c
View file @
b3f14e00
...
...
@@ -106,7 +106,7 @@ static int bake_pmem_backend_initialize(bake_provider_t provider,
free
(
new_context
->
filename
);
free
(
new_context
->
root
);
free
(
new_context
);
return
BAKE_ERR_
PMEM
;
return
BAKE_ERR_
NOENT
;
}
/* check to make sure the root is properly set */
...
...
src/util.c
View file @
b3f14e00
...
...
@@ -51,6 +51,12 @@ static char* bake_err_str(int ret)
case
BAKE_ERR_OP_UNSUPPORTED
:
return
"Operation not supported"
;
break
;
case
BAKE_ERR_NOENT
:
return
"Entry does not exist"
;
break
;
case
BAKE_ERR_EXIST
:
return
"Entry already exists"
;
break
;
default:
return
"Unknown error"
;
break
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment