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
|
|
|
{
|
|
|
|
|
2013-02-17 16:22:51 +01:00
|
|
|
unsigned process;
|
2010-10-17 21:50:55 +02:00
|
|
|
int result;
|
2013-02-17 16:22:51 +01:00
|
|
|
int i;
|
2010-10-17 21:50:55 +02:00
|
|
|
|
2013-02-17 16:22:51 +01:00
|
|
|
if ( strlen(param) == 0 )
|
2010-10-17 21:50:55 +02:00
|
|
|
{
|
2010-10-21 01:58:36 +02:00
|
|
|
printf(" kill <PID>\n\r");
|
2013-02-17 16:22:51 +01:00
|
|
|
return TRUE;
|
2010-10-17 21:50:55 +02:00
|
|
|
}
|
2013-02-17 16:22:51 +01:00
|
|
|
|
|
|
|
if (!strcmp(param, "all"))
|
|
|
|
{
|
|
|
|
for (i = 2;i<256;i++)
|
|
|
|
{
|
|
|
|
kol_kill_process(i);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
2010-10-17 21:50:55 +02:00
|
|
|
else
|
|
|
|
{
|
2013-02-17 16:22:51 +01:00
|
|
|
process = _atoi(param);
|
|
|
|
if ( 0 != process )
|
2010-10-17 21:50:55 +02:00
|
|
|
{
|
2013-02-17 16:22:51 +01:00
|
|
|
result = kol_process_kill_pid(process);
|
2010-10-17 21:50:55 +02:00
|
|
|
if (result < 0)
|
|
|
|
return FALSE;
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2013-02-17 16:22:51 +01:00
|
|
|
|