herdd: task_duplicate test
This commit is contained in:
@@ -122,11 +122,14 @@ int main(int argc, const char *argv[], const char *envp[])
|
||||
|
||||
if (new_task == KERN_HANDLE_INVALID) {
|
||||
kern_log("this is the child");
|
||||
long r = printf("hello\n");
|
||||
kern_logf("printf returned %ld (%d)", r, (errno));
|
||||
} else {
|
||||
kern_log("this is the parent");
|
||||
long r = printf("goodbye\n");
|
||||
kern_logf("printf returned %ld (%d)", r, (errno));
|
||||
}
|
||||
|
||||
printf("hello\n");
|
||||
|
||||
kern_logf("exiting (%s)", strerror(EFTYPE));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -95,8 +95,9 @@ int runlevel_load(const char *path, struct runlevel **out)
|
||||
fx_stream *in = fx_stream_open_fp(fp);
|
||||
fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
|
||||
fx_object *data;
|
||||
fx_status status = fx_serial_ctx_deserialise(ctx, in, &data, 0);
|
||||
if (!FX_OK(status)) {
|
||||
fx_result result = fx_serial_ctx_deserialise(ctx, in, &data, 0);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
free(rl);
|
||||
errno = EFTYPE;
|
||||
return -1;
|
||||
|
||||
@@ -76,7 +76,7 @@ static int parse_service_data(fx_object *in, struct service *out)
|
||||
size_t i = 0;
|
||||
fx_foreach_ptr(fx_string, role, it)
|
||||
{
|
||||
const char *role_cstr = fx_string_ptr(role);
|
||||
const char *role_cstr = fx_string_get_cstr(role);
|
||||
if (!strcmp(role_cstr, "NamespaceProvider")) {
|
||||
out->s_roles |= SVC_ROLE_NAMESPACE_PROVIDER;
|
||||
}
|
||||
@@ -107,8 +107,9 @@ int service_load(const char *path, struct service **out)
|
||||
fx_stream *in = fx_stream_open_fp(fp);
|
||||
fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
|
||||
fx_object *data;
|
||||
fx_status status = fx_serial_ctx_deserialise(ctx, in, &data, 0);
|
||||
if (!FX_OK(status)) {
|
||||
fx_result result = fx_serial_ctx_deserialise(ctx, in, &data, 0);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
free(rl);
|
||||
errno = EFTYPE;
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user