From b33139396e54a829dc1230281fa6ce4439c9d64d Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Thu, 7 May 2020 13:54:04 +0200 Subject: [PATCH] debug --- main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 40705fc..d495648 100644 --- a/main.c +++ b/main.c @@ -3,6 +3,8 @@ #include #include #include +#include +#include #define HOSTNAME "lalis" @@ -80,11 +82,11 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] ) FILE *fh1; char child_path[128]; char str[1024]; - char * pch; +// char * pch; int child_pid[10]; int flag = 0; int r; - int x = 0; +// int x = 0; int pid = ppid; int level = 0; int retval = 0; @@ -159,6 +161,7 @@ int main() int pids[n_ssh]; int flag[n_ssh]; int rinfo; + int status; // char path[1024]; char commande[] = "/usr/local/bin/send_sms"; char logfile[] = "/var/log/sshdetect.log"; @@ -288,6 +291,7 @@ int main() } } sleep(2); + waitpid(-1, &status ,WNOHANG) } start = 0; }