Author: Andy Green Date: Fri Jul 10 08:19:28 2026 +0100 cov diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c8c4c3..9fc0a84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,9 @@ if (WIN32) list(APPEND CMAKE_PREFIX_PATH "C:/Program Files (x86)/libwebsockets" "C:/Program Files/libwebsockets") endif() find_package(libwebsockets CONFIG REQUIRED) +if (NOT LWS_CMAKE_DIR AND libwebsockets_DIR) + set(LWS_CMAKE_DIR ${libwebsockets_DIR}) +endif() list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) include(CheckCSourceCompiles) include(CheckSymbolExists) diff --git a/assets/linux-debian13.svg b/assets/linux-debian13.svg new file mode 100644 index 0000000..b327508 --- /dev/null +++ b/assets/linux-debian13.svg @@ -0,0 +1,53 @@ + + + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +sid + + diff --git a/src/builder/b-deletion.c b/src/builder/b-deletion.c index ea0460a..97c4d9e 100644 --- a/src/builder/b-deletion.c +++ b/src/builder/b-deletion.c @@ -285,7 +285,8 @@ sai_deletion_worker(const char *home_dir_unused) return 1; } - chmod(info.iface, 0600); + if (chmod(info.iface, 0600) < 0) + lwsl_warn("%s: failed to chmod UDS %s: %s\n", __func__, info.iface, strerror(errno)); lwsl_notice("STUB-READY (sai-deletion)\n"); while (lws_service(cx, 0) >= 0) diff --git a/src/builder/b-task.c b/src/builder/b-task.c index 0f20f67..6ef1402 100644 --- a/src/builder/b-task.c +++ b/src/builder/b-task.c @@ -244,11 +244,15 @@ static void saib_start_artifact_upload(struct sai_nspawn *ns); int saib_set_ns_state(struct sai_nspawn *ns, int state) { - struct sai_plat_server *spm = ns ? ns->spm : NULL; + struct sai_plat_server *spm; - if (ns) - lwsl_notice("%s: ns=%p (%s) changing state from %d to %d\n", __func__, - (void*)ns, ns->task ? ns->task->uuid : "null", ns->state, state); + if (!ns) + return -1; + + spm = ns->spm; + + lwsl_notice("%s: ns=%p (%s) changing state from %d to %d\n", __func__, + (void*)ns, ns->task ? ns->task->uuid : "null", ns->state, state); ns->state = (uint8_t)state; ns->state_changed = 1; @@ -734,10 +738,8 @@ saib_sul_task_cancel(struct lws_sorted_usec_list *sul) lws_spawn_piped_kill_child_process(ns->op->lsp); if (!--ns->term_budget) { lwsl_err("%s: unable to kill child process -> destroying ns forcibly\n", __func__); - if (ns->op) { - ns->op->ns = NULL; - ns->op = NULL; - } + ns->op->ns = NULL; + ns->op = NULL; saib_task_destroy(ns); return; } diff --git a/src/server/s-comms.c b/src/server/s-comms.c index da556c0..f258c4c 100644 --- a/src/server/s-comms.c +++ b/src/server/s-comms.c @@ -130,7 +130,9 @@ s_callback_ws(struct lws *wsi, enum lws_callback_reasons reason, void *user, { const char *conf_dir = "/etc/sai/server"; - lws_pvo_get_str(in, "config-dir", &conf_dir); + if (lws_pvo_get_str(in, "config-dir", &conf_dir)) { + lwsl_info("%s: config-dir pvo not found, using default %s\n", __func__, conf_dir); + } sais_config_watchers(vhd, conf_dir); } diff --git a/src/web/CMakeLists.txt b/src/web/CMakeLists.txt index 4f37deb..f06cbfa 100644 --- a/src/web/CMakeLists.txt +++ b/src/web/CMakeLists.txt @@ -127,6 +127,7 @@ add_dependencies(${SUB} sai_git_hash) ../../assets/linux-fedora-32-riscv.svg ../../assets/linux-fedora-32.svg ../../assets/linux-fedora44.svg + ../../assets/linux-debian13.svg ../../assets/linux-gentoo.svg ../../assets/linux-ubuntu-1804.svg ../../assets/linux-ubuntu-2004.svg diff --git a/src/web/w-ws-browser.c b/src/web/w-ws-browser.c index 3a4919e..295ed0b 100644 --- a/src/web/w-ws-browser.c +++ b/src/web/w-ws-browser.c @@ -344,8 +344,9 @@ saiw_pss_schedule_taskinfo(struct pss *pss, const char *task_uuid, int logsub, i memset(&task_reply, 0, sizeof(task_reply)); lws_dll2_owner_clear(&task_reply.runs); lws_snprintf(qu, sizeof(qu), " and uuid='%s'", esc); - lws_struct_sq3_deserialize(pdb, qu, "run desc", lsm_schema_sq3_map_task, - &task_reply.runs, &runs_ac, 0, 100); + if (lws_struct_sq3_deserialize(pdb, qu, "run desc", lsm_schema_sq3_map_task, + &task_reply.runs, &runs_ac, 0, 100) < 0) + lwsl_err("%s: runs deserialize failed\n", __func__); sai_event_db_close(&pss->vhd->sqlite3_cache, &pdb); if (n < 0 || !o.head) @@ -1076,8 +1077,9 @@ saiw_browser_queue_overview(struct vhd *vhd, struct pss *pss) struct lwsac *ac_watchers = NULL; lws_dll2_owner_clear(&e->watcher_owner); lws_snprintf(wfilt, sizeof(wfilt), " and event_hash='%s'", e->uuid); - lws_struct_sq3_deserialize(vhd->pdb, wfilt, "created", - lsm_schema_sq3_map_watcher, &e->watcher_owner, &ac_watchers, 0, 0); + if (lws_struct_sq3_deserialize(vhd->pdb, wfilt, "created", + lsm_schema_sq3_map_watcher, &e->watcher_owner, &ac_watchers, 0, 0) < 0) + lwsl_err("%s: watchers deserialize failed\n", __func__); js = lws_struct_json_serialize_create( lsm_schema_json_map_event,