Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 153)
+++ /trunk/docs/Changelog	(revision 154)
@@ -1,3 +1,5 @@
 2.4.2:
+	* fix more compiler warnings, and a potential (compiler-dependent)
+	  NULL dereference in the unix entropy collector
 	* fix some compiler warnings
 	* use -D_FORTIFY_SOURCE=1 -fstack-protector-all instead
Index: /trunk/src/sh_entropy.c
===================================================================
--- /trunk/src/sh_entropy.c	(revision 153)
+++ /trunk/src/sh_entropy.c	(revision 154)
@@ -771,5 +771,5 @@
   i = 0;
 
-  while (source[i].command != NULL) {
+  while (source_template[i].command != NULL) {
 
     j = 0;
Index: /trunk/src/sh_mem.c
===================================================================
--- /trunk/src/sh_mem.c	(revision 153)
+++ /trunk/src/sh_mem.c	(revision 154)
@@ -261,5 +261,5 @@
 {
   volatile memlist_t * this   = memlist;
-  memlist_t          * before = memlist;
+  volatile memlist_t * before = memlist;
   unsigned long        size   = 0;
 
@@ -315,5 +315,5 @@
   free(a);
   if (this)
-    free(this);
+    free((void*)this);
   ++Free_Count;
   --Now_Alloc_Count;
Index: /trunk/src/sh_unix.c
===================================================================
--- /trunk/src/sh_unix.c	(revision 153)
+++ /trunk/src/sh_unix.c	(revision 154)
@@ -551,4 +551,8 @@
 #endif
 {
+#if defined(SL_DEBUG)
+  int retval;
+#endif
+
 #if defined(SA_SIGACTION_WORKS)
   if (signal_info != NULL && signal_info->si_code == SI_USER)
@@ -586,10 +590,14 @@
 #endif
       safe_logger (mysignal, 0, NULL);
-      chdir ("/");
+      do {
+	retval = chdir ("/");
+      } while (retval < 0 && errno == EINTR);
       raise(SIGFPE);
     }
   else if (immediate_exit_fast == 2)
     {
-      chdir ("/");
+      do {
+	retval = chdir ("/");
+      } while (retval < 0 && errno == EINTR);
       raise(SIGFPE);
     }
@@ -624,5 +632,8 @@
 #endif
 
-  chdir ("/");
+  do {
+    retval = chdir ("/");
+  } while (retval < 0 && errno == EINTR);
+
   raise(SIGFPE);
 #endif
Index: /trunk/src/sh_utmp.c
===================================================================
--- /trunk/src/sh_utmp.c	(revision 153)
+++ /trunk/src/sh_utmp.c	(revision 154)
@@ -771,8 +771,17 @@
 #endif
 
+/* These variables are not used anywhere. They only exist
+ * to assign &userold, &user to them, which keeps gcc from
+ * putting them into a register, and avoids the 'clobbered
+ * by longjmp' warning. And no, 'volatile' proved insufficient.
+ */
+void * sh_dummy_userold = NULL;
+void * sh_dummy_user    = NULL;
+
+
 static void sh_utmp_addlogin (struct SH_UTMP_S * ut)
 {
-  struct          log_user   * user     = userlist;
-  volatile struct log_user   * userold  = userlist;
+  struct log_user   * user     = userlist;
+  struct log_user   * userold  = userlist;
 #ifdef HAVE_UTTYPE  
   struct log_user   * username = userlist;
@@ -785,4 +794,10 @@
 
   SL_ENTER(_("sh_utmp_addlogin"));
+
+  /* Take the address to keep gcc from putting them into registers. 
+   * Avoids the 'clobbered by longjmp' warning. 
+   */
+  sh_dummy_userold = (void*) &userold;
+  sh_dummy_user    = (void*) &user;
 
   if (ut->ut_line[0] == '\0')
@@ -804,5 +819,5 @@
   while (user != NULL) 
     {
-      if (0 == sl_strncmp(user->ut_tty, ut->ut_line, UT_LINESIZE) ) 
+      if (0 == sl_strncmp((char*)(user->ut_tty), ut->ut_line, UT_LINESIZE) ) 
 	break;
       userold = user;
@@ -827,10 +842,10 @@
 	  user = SH_ALLOC(sizeof(struct log_user));
 	  user->next       = userlist;
-	  userlist         = user;
+	  userlist         = (struct log_user *) user;
 	}
-      (void) sl_strlcpy(user->ut_tty,  ut->ut_line, UT_LINESIZE+1);
-      (void) sl_strlcpy(user->name,    ut->ut_name, UT_NAMESIZE+1);
+      (void) sl_strlcpy((char*)(user->ut_tty),  ut->ut_line, UT_LINESIZE+1);
+      (void) sl_strlcpy((char*)(user->name),    ut->ut_name, UT_NAMESIZE+1);
 #ifdef HAVE_UTHOST
-      (void) sl_strlcpy(user->ut_host, ut->ut_host, UT_HOSTSIZE+1);
+      (void) sl_strlcpy((char*)(user->ut_host), ut->ut_host, UT_HOSTSIZE+1);
 #else
       user->ut_host[0] = '\0';
@@ -838,5 +853,5 @@
 #ifdef HAVE_UTADDR
       /*@-type@*//* ut_addr does exist !!! */
-      (void) sl_strlcpy(user->ut_ship, 
+      (void) sl_strlcpy((char*)(user->ut_ship), 
 			my_inet_ntoa(*(struct in_addr*)&(ut->ut_addr)), 16);
       /*@+type@*/
@@ -848,5 +863,5 @@
           || 0 == sl_strncmp(ut->ut_line, _("ttyq"), 4) /* in virt. console  */
 	  ) {
-	status = sh_utmp_login_a(user->name);
+	status = sh_utmp_login_a((char*)user->name);
 	SH_MUTEX_LOCK(mutex_thread_nolog);
 	(void) sh_unix_time (user->time, ttt, TIM_MAX);
@@ -872,7 +887,7 @@
 	SH_MUTEX_UNLOCK(mutex_thread_nolog);
       } else
-	if (0 != sh_utmp_is_virtual(ut->ut_line, user->ut_host))
+	if (0 != sh_utmp_is_virtual(ut->ut_line, (char*)user->ut_host))
 	  {       
-	    status = sh_utmp_login_a(user->name);
+	    status = sh_utmp_login_a((char*)user->name);
 	    SH_MUTEX_LOCK(mutex_thread_nolog);
 	    (void) sh_unix_time (user->time, ttt, TIM_MAX);
@@ -911,5 +926,5 @@
       if (user != NULL)
 	{
-	  status = sh_utmp_login_r(user->name);
+	  status = sh_utmp_login_r((char*)user->name);
 	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  (void) sh_unix_time (ut->ut_time, ttt, TIM_MAX);
@@ -937,6 +952,6 @@
 	  if (user == userlist)
 	    userlist = user->next;
-	  sh_utmp_logout_morechecks(user);
-	  SH_FREE(user);
+	  sh_utmp_logout_morechecks((struct log_user *)user);
+	  SH_FREE((struct log_user *)user);
 	  user = NULL;
 	}
