2010-10-17 21:50:55 +02:00
|
|
|
|
2013-02-17 16:22:51 +01:00
|
|
|
int cmd_kill(char param[])
|
2010-10-17 21:50:55 +02:00
|
|
|
{
|
2021-06-12 23:34:41 +02:00
|
|
|
unsigned process;
|
|
|
|
int result;
|
|
|
|
int i;
|
2010-10-17 21:50:55 +02:00
|
|
|
|
2021-06-12 23:34:41 +02:00
|
|
|
if ( strlen(param) == 0 ) {
|
|
|
|
printf(CMD_KILL_USAGE);
|
|
|
|
return TRUE;
|
2010-10-17 21:50:55 +02:00
|
|
|
}
|
2013-02-17 16:22:51 +01:00
|
|
|
|
2021-06-12 23:34:41 +02:00
|
|
|
if (!strcmp(param, "all")) {
|
|
|
|
for (i = 2;i<256;i++) {
|
|
|
|
kol_kill_process(i);
|
2013-02-17 16:22:51 +01:00
|
|
|
}
|
2021-06-12 23:34:41 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
process = atoi(param);
|
|
|
|
if ( 0 != process ) {
|
|
|
|
result = kol_process_kill_pid(process);
|
|
|
|
if (result < 0)
|
|
|
|
return FALSE;
|
|
|
|
else
|
|
|
|
return TRUE;
|
2010-10-17 21:50:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2013-02-17 16:22:51 +01:00
|
|
|
|