herdd: task_duplicate test

This commit is contained in:
2026-04-20 22:17:28 +01:00
parent 109ee7b79c
commit 6c80d375f2
3 changed files with 12 additions and 7 deletions
+5 -2
View File
@@ -122,11 +122,14 @@ int main(int argc, const char *argv[], const char *envp[])
if (new_task == KERN_HANDLE_INVALID) { if (new_task == KERN_HANDLE_INVALID) {
kern_log("this is the child"); kern_log("this is the child");
long r = printf("hello\n");
kern_logf("printf returned %ld (%d)", r, (errno));
} else { } else {
kern_log("this is the parent"); 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; return 0;
} }
+3 -2
View File
@@ -95,8 +95,9 @@ int runlevel_load(const char *path, struct runlevel **out)
fx_stream *in = fx_stream_open_fp(fp); fx_stream *in = fx_stream_open_fp(fp);
fx_serial_ctx *ctx = fx_toml_serial_ctx_create(); fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
fx_object *data; fx_object *data;
fx_status status = fx_serial_ctx_deserialise(ctx, in, &data, 0); fx_result result = fx_serial_ctx_deserialise(ctx, in, &data, 0);
if (!FX_OK(status)) { if (fx_result_is_error(result)) {
fx_throw(result);
free(rl); free(rl);
errno = EFTYPE; errno = EFTYPE;
return -1; return -1;
+4 -3
View File
@@ -76,7 +76,7 @@ static int parse_service_data(fx_object *in, struct service *out)
size_t i = 0; size_t i = 0;
fx_foreach_ptr(fx_string, role, it) 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")) { if (!strcmp(role_cstr, "NamespaceProvider")) {
out->s_roles |= SVC_ROLE_NAMESPACE_PROVIDER; 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_stream *in = fx_stream_open_fp(fp);
fx_serial_ctx *ctx = fx_toml_serial_ctx_create(); fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
fx_object *data; fx_object *data;
fx_status status = fx_serial_ctx_deserialise(ctx, in, &data, 0); fx_result result = fx_serial_ctx_deserialise(ctx, in, &data, 0);
if (!FX_OK(status)) { if (fx_result_is_error(result)) {
fx_throw(result);
free(rl); free(rl);
errno = EFTYPE; errno = EFTYPE;
return -1; return -1;