From cae5f61bc5fe79f6842e5ca1a825aa6b9d40298d Mon Sep 17 00:00:00 2001 From: turbocat Date: Thu, 4 Mar 2021 08:50:03 +0000 Subject: [PATCH] SHELL: - Added new SC_PING api - Renamed from SC_GET_PID to SC_PID git-svn-id: svn://kolibrios.org@8634 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/shell/cmd/cmd_ps.c | 2 +- programs/system/shell/modules/module_program_console.c | 8 ++++++-- programs/system/shell/program_console.h | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/programs/system/shell/cmd/cmd_ps.c b/programs/system/shell/cmd/cmd_ps.c index ce09f0e4d1..1caa170324 100644 --- a/programs/system/shell/cmd/cmd_ps.c +++ b/programs/system/shell/cmd/cmd_ps.c @@ -19,7 +19,7 @@ for (i = 1;;i++) { n = kol_process_info(i, buf1k); memcpy(&PID, buf1k+30 ,sizeof(unsigned)); - STATE = *(buf1k+50); + STATE = *(buf1k+50); if (9 != STATE) { if (!sel || 0 == strnicmp(param, buf1k+10, 10)) diff --git a/programs/system/shell/modules/module_program_console.c b/programs/system/shell/modules/module_program_console.c index 57c5602db2..c10f9d7c68 100644 --- a/programs/system/shell/modules/module_program_console.c +++ b/programs/system/shell/modules/module_program_console.c @@ -76,14 +76,18 @@ for (i = 0; i < 30; i++) *buffer = SC_OK; break; - case SC_GET_PID: + case SC_PID: buf1k=malloc(1024); kol_process_info(-1, buf1k); - memcpy(buffer+1, buf1k+30, sizeof(unsigned)); + memcpy(buffer+1, buf1k+30, sizeof(unsigned)); *buffer = SC_OK; free(buf1k); break; + case SC_PING: + *buffer = SC_OK; + break; + default: #if LANG_ENG printf (" Error in console application.\n\r"); diff --git a/programs/system/shell/program_console.h b/programs/system/shell/program_console.h index 880cfe7f4f..43f5b35325 100644 --- a/programs/system/shell/program_console.h +++ b/programs/system/shell/program_console.h @@ -6,4 +6,5 @@ #define SC_GETC 4 #define SC_GETS 5 #define SC_CLS 6 -#define SC_GET_PID 7 +#define SC_PID 7 +#define SC_PING 8