SHELL 0.8.2

- big refactoring, now uses libc.obj
- added kfetch command

git-svn-id: svn://kolibrios.org@8827 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad)
2021-06-12 21:34:41 +00:00
parent 112c948922
commit 68cf3e4293
59 changed files with 1617 additions and 2317 deletions
+9 -21
View File
@@ -1,40 +1,28 @@
int cmd_pkill(char param[])
{
int i=1, n=0; int process_count=0;
char *buf1k=NULL;
int i = 1, n = 0; int process_count = 0;
char *buf1k = NULL;
unsigned PID=0;
#ifdef LANG_RUS
#define PKILL_HELP " pkill <¨¬ï_¯à®æ¥áá >\n\r"
#define PKILL_KILL " PID: %u - 㡨â\n"
#define PKILL_NOT_KILL " PID: %u - ­¥ 㡨â\n"
#define PKILL_NOT_FOUND " à®æ¥áᮢ á â ª¨¬ ¨¬¥­¥¬ ­¥ ­ ©¤¥­®!\n"
#else
#define PKILL_HELP " pkill <process_name>\n\r"
#define PKILL_KILL " PID: %u - killed\n"
#define PKILL_NOT_KILL " PID: %u - not killed\n"
#define PKILL_NOT_FOUND " No processes with this name were found!\n"
#endif
if(!strlen(param)){
printf(PKILL_HELP);
printf(CMD_PKILL_HELP);
return TRUE;
}
buf1k = malloc(1024);
if(buf1k==NULL){
if (buf1k == NULL){
return FALSE;
}
while(i!=n){
while (i != n) {
n = kol_process_info(i, buf1k);
if(!strnicmp(buf1k+10, param, 10)){
memcpy(&PID, buf1k+30 ,sizeof(unsigned));
if(kol_process_kill_pid(PID)){
printf(PKILL_NOT_KILL, PID);
printf(CMD_PKILL_NOT_KILL, PID);
}else{
printf(PKILL_KILL, PID);
printf(CMD_PKILL_KILL, PID);
}
process_count++;
}
@@ -42,7 +30,7 @@ int cmd_pkill(char param[])
}
if(!process_count){
printf(PKILL_NOT_FOUND);
printf(CMD_PKILL_NOT_FOUND);
}
free(buf1k);