Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 398)
+++ trunk/docs/Changelog	(revision 399)
@@ -1,5 +1,7 @@
 3.0.3:
+	* make sure sh_processes_readps cannot hang forever
 	* fix for deadlock if sh_processes_readps hangs
 	* fix for deadlock if suid check and inotify are used together
+	  (reported by A. Jack)
 	* fixed problem with samhain_stealth.c (handle input config
 	  files that don't end with a newline)
Index: trunk/src/sh_processcheck.c
===================================================================
--- trunk/src/sh_processcheck.c	(revision 398)
+++ trunk/src/sh_processcheck.c	(revision 399)
@@ -553,4 +553,5 @@
   SL_RETURN((0), _("sh_prochk_set_psarg"));
 #else
+  (void) str;
   sh_prochk_psarg = NULL;
   SL_RETURN((-1), _("sh_prochk_set_psarg"));
@@ -868,4 +869,6 @@
   char c;
   unsigned int  pos = 0;
+#define SH_TWAIT_MAX 60
+  volatile unsigned int  twait = 0;
   char tstr[256];
   enum { SKIP_TO_WS, SKIP_WS, SKIP_TO_WS2, SKIP_WS2, GET_NUM, SKIP_END, GET_NUM2 } line;
@@ -891,7 +894,9 @@
 	      break;
 	    }
-	  else if (errno == EAGAIN)
+	  else if ((errno == EAGAIN) && (twait < SH_TWAIT_MAX))
 	    {
 	      clearerr(in);
+	      retry_msleep(1, 0);
+	      ++twait;
 	      continue;
 	    }
