Subversion Repositories Kolibri OS

Rev

Rev 3247 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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