kolibrios-fun/programs/system/shell/cmd/cmd_kill.c
Albom deca8b884f Shell v0.6.1. Some minor improvements.
git-svn-id: svn://kolibrios.org@3247 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-02-17 15:22:51 +00:00

39 lines
461 B
C

int cmd_kill(char param[])
{
unsigned process;
int result;
int i;
if ( strlen(param) == 0 )
{
printf(" kill <PID>\n\r");
return TRUE;
}
if (!strcmp(param, "all"))
{
for (i = 2;i<256;i++)
{
kol_kill_process(i);
}
return TRUE;
}
else
{
process = _atoi(param);
if ( 0 != process )
{
result = kol_process_kill_pid(process);
if (result < 0)
return FALSE;
else
return TRUE;
}
}
}