Subversion Repositories Kolibri OS

Rev

Rev 3245 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2.  
  3. int cmd_kill(char param[])
  4. {
  5.  
  6. unsigned process;
  7. int result;
  8. int i;
  9.  
  10. if ( strlen(param) == 0 )
  11.         {
  12.         printf("  kill <PID>\n\r");
  13.         return TRUE;
  14.         }
  15.  
  16. if (!strcmp(param, "all"))
  17.         {
  18.         for (i = 2;i<256;i++)
  19.                 {
  20.                 kol_kill_process(i);
  21.                 }
  22.         return TRUE;
  23.         }
  24. else
  25.         {
  26.         process = _atoi(param);
  27.         if ( 0 != process )
  28.                 {
  29.                 result = kol_process_kill_pid(process);
  30.                 if (result < 0)
  31.                         return FALSE;
  32.                 else
  33.                         return TRUE;
  34.                 }
  35.         }
  36.  
  37. }
  38.  
  39.