MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_proc_classify

Function cbm_proc_classify

src/foundation/subprocess.c:58–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56#endif
57
58cbm_proc_outcome_t cbm_proc_classify(bool exited_normally, int exit_code, int term_signal,
59 bool timed_out) {
60 if (timed_out) {
61 return CBM_PROC_HANG;
62 }
63 if (!exited_normally) {
64 /* POSIX signal death. */
65#ifndef _WIN32
66 if (cbm_is_fault_signal(term_signal)) {
67 return CBM_PROC_CRASH;
68 }
69#else
70 (void)term_signal;
71#endif
72 return CBM_PROC_KILLED;
73 }
74 /* Exited with a code. A Windows NTSTATUS exception code is a crash; on POSIX
75 * exit codes are 0..255 so this branch never misfires there. */
76 if ((unsigned)exit_code == CBM_WIN_CONTROL_C_EXIT) {
77 return CBM_PROC_KILLED;
78 }
79 if ((unsigned)exit_code >= CBM_WIN_CRASH_CODE_MIN) {
80 return CBM_PROC_CRASH;
81 }
82 return (exit_code == 0) ? CBM_PROC_CLEAN : CBM_PROC_EXIT_NONZERO;
83}
84
85const char *cbm_proc_outcome_str(cbm_proc_outcome_t o) {
86 switch (o) {

Callers 3

cbm_win_capture_rootFunction · 0.85
cbm_posix_capture_rootFunction · 0.85
test_subprocess.cFile · 0.85

Calls 1

cbm_is_fault_signalFunction · 0.85

Tested by

no test coverage detected