Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

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