Index: trunk/src/samhain.c
===================================================================
--- trunk/src/samhain.c	(revision 161)
+++ trunk/src/samhain.c	(revision 162)
@@ -362,4 +362,6 @@
   sh.prg_name[7] = '\0';
 #endif
+
+  sh.pid = (UINT64) getpid();
 
   /* The flags.
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 161)
+++ trunk/src/sh_hash.c	(revision 162)
@@ -1206,5 +1206,7 @@
 	  {
 	    dlog(1, FIL__, __LINE__, 
-		 _("The checksum of the file signature database has changed since startup.\n"));
+		 _("The checksum of the file signature database has changed since startup: %s -> %s\n"),
+		 sh.data.hash, sh_tiger_hash (file_path('D', 'R'), fd, TIGER_NOLIM, 
+					   hashbuf, sizeof(hashbuf)));
 	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_AUTH,
 			     ( (NULL == file_path('D', 'R')) ? _("(null)") :
Index: trunk/src/sh_kern.c
===================================================================
--- trunk/src/sh_kern.c	(revision 161)
+++ trunk/src/sh_kern.c	(revision 162)
@@ -266,6 +266,7 @@
  * Interrupt Descriptor Table
  */
-
+#ifdef HAVE_ASM_SEGMENT_H
 #include <asm/segment.h>
+#endif
 
 #define SH_MAXIDT   256
@@ -276,12 +277,20 @@
 {
   switch (segment) {
+#ifdef __KERNEL_CS
   case __KERNEL_CS:
     return _("KERNEL_CS");
+#endif
+#ifdef __KERNEL_DS
   case __KERNEL_DS:
     return _("KERNEL_DS");
+#endif
+#ifdef __USER_CS
   case __USER_CS:
     return _("USER_CS");
+#endif
+#ifdef __USER_DS
   case __USER_DS:
     return _("USER_DS");
+#endif
   default:
     return _("unknown");
@@ -903,5 +912,5 @@
   (void) sl_strlcpy (theFile.fullpath, pcipath, PATH_MAX);
   theFile.check_mask  = sh_files_maskof(SH_LEVEL_READONLY);
-  theFile.check_mask &= ~(MODI_MTM|MODI_CTM);
+  theFile.check_mask &= ~(MODI_MTM|MODI_CTM|MODI_INO);
   CLEAR_SH_FFLAG_REPORTED(theFile.file_reported);
   theFile.attr_string = NULL;
@@ -938,4 +947,5 @@
   struct stat buf;
   int         fd;
+  int         status;
 
   if (0 == stat(pcipath, &buf))
@@ -945,5 +955,7 @@
        */
       fd = open ( pcipath, O_RDWR );
-      write( fd, "1", 1 );
+      do {
+	status = write( fd, "1", 1 );
+      } while (status < 0 && errno == EINTR);
       close ( fd );
 
@@ -951,5 +963,7 @@
 
       fd = open ( pcipath, O_RDWR );
-      write( fd, "0", 1 );
+      do {
+	status = write( fd, "0", 1 );
+      } while (status < 0 && errno == EINTR);
       close ( fd );
     }
Index: trunk/src/sh_portcheck.c
===================================================================
--- trunk/src/sh_portcheck.c	(revision 161)
+++ trunk/src/sh_portcheck.c	(revision 162)
@@ -129,4 +129,5 @@
 #include "sh_utils.h"
 #include "sh_modules.h"
+#include "sh_static.h"
 #include "sh_pthread.h"
 
@@ -897,5 +898,5 @@
 	    
   SH_MUTEX_LOCK(mutex_resolv);
-  hent = gethostbyname(portchk_hostname);
+  hent = sh_gethostbyname(portchk_hostname);
 
   while (hent && hent->h_addr_list[i] && (iface_list.used < SH_IFACE_MAX))
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 161)
+++ trunk/src/sh_unix.c	(revision 162)
@@ -1866,4 +1866,5 @@
 
     setsid();            /* should not fail         */
+    sh.pid = (UINT64) getpid();
 
     switch (aud_fork(FIL__, __LINE__)) {
@@ -1876,4 +1877,5 @@
      */
     sh_unix_memlock();
+    sh.pid = (UINT64) getpid();
 
   } else {
@@ -3844,5 +3846,5 @@
       sl_close(fd);
 
-      if (status == (int) getpid())
+      if (status > 0 && (unsigned int) status == sh.pid)
 	{
 	  if (filename != NULL)
@@ -4007,5 +4009,5 @@
   SL_ENTER(_("sh_unix_lock"));
 
-  sprintf (myPid, "%ld\n", (long) getpid());           /* known to fit  */
+  sprintf (myPid, "%ld\n", (long) sh.pid);             /* known to fit  */
 
   fd = sl_open_safe_rdwr (lockfile, SL_YESPRIV);       /* fails if file exists */
Index: trunk/src/slib.c
===================================================================
--- trunk/src/slib.c	(revision 161)
+++ trunk/src/slib.c	(revision 162)
@@ -577,11 +577,4 @@
 }
 
-#if !defined(HOST_IS_I86SOLARIS)
-#if !defined (_GNU_SOURCE) && !defined(__linux__)
-/* flawfinder: ignore */
-extern int vsnprintf ( char *str, size_t n,
-		       const char *format, va_list ap );
-#endif
-#endif
 
 #if !defined (VA_COPY)
