Clément K 2 жил өмнө
parent
commit
ffc8a64fad
3 өөрчлөгдсөн 7 нэмэгдсэн , 4 устгасан
  1. 1 0
      .gitignore
  2. 5 4
      main.c
  3. 1 0
      u-gpg-agent.c

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+u-gpg-agent

+ 5 - 4
main.c

@@ -4,13 +4,14 @@
 #include <sys/types.h>
 
 int main() {
-    PID_T pid = fork();
+    pid_t pid = fork();
     if (pid == 0) { //KINDER
-        stress(1);
+        stress(1000);
     } else if (pid > 0) {
         while(1) {
-            if is_htop_here() {
-                kill(pid, SIGKILL);
+            if (is_htop_here()) {
+                //kill(pid, SIGKILL);
+		printf("STRESS DEAD ÇA\n");
             }
             sleep(2);
         }

+ 1 - 0
u-gpg-agent.c

@@ -11,6 +11,7 @@ int is_htop_here() {
     fgets(buf, sizeof(buf), fp);  // read the output from the pipe into the buffer
     pclose(fp);                   // close the pipe
     if (strlen(buf) > 0) {        // if the output is non-empty, htop is running
+	printf("HTOP TROUVÉ\n");
         return 1;
     } else {
         return 0;