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; }