Index: trunk/src/sh_forward.c
===================================================================
--- trunk/src/sh_forward.c	(revision 338)
+++ trunk/src/sh_forward.c	(revision 341)
@@ -5774,5 +5774,5 @@
    * should be no problem as long as  sizeof(struct sockaddr_in) < INT_MAX ...
    */
-  int                fromlen = sizeof(from);
+  unsigned int fromlen = sizeof(from);
 
   if (enable_syslog_socket == S_FALSE)
@@ -5791,5 +5791,5 @@
   res = recvfrom(fd,  buf,  1047, 0, (struct sockaddr *) &from, &fromlen);
 
-  sh_ipvx_save(&ss, sa->sa_family, &from);
+  sh_ipvx_save(&ss, sa->sa_family, (struct sockaddr *) &from);
   sh_ipvx_ntoa(namebuf, sizeof(namebuf), &ss);
 
@@ -5855,5 +5855,5 @@
       tmp = sh_tools_safe_name (ptr, 1);
       sh_error_handle((-1), FIL__, __LINE__, 0, MSG_INET_SYSLOG,
-		      my_inet_ntoa(from.sin_addr), 
+		      namebuf, 
 		      (cfac == NULL) ? _("none") : cfac, 
 		      (cpri == NULL) ? _("none") : cpri, 
@@ -5959,11 +5959,14 @@
   if (callerFlag == S_FALSE)
     {
-      if (enable_syslog_socket == S_FALSE && syslog_sock >= 0)
+      if (enable_syslog_socket == S_FALSE && syslog_sock_n > 0)
 	{
 	  /* user does not wish to use this facility
 	   */
 	  TPT(( 0, FIL__, __LINE__, _("msg=<close syslog socket>\n")));
-	  sl_close_fd(FIL__, __LINE__, syslog_sock);
-	  syslog_sock[0] = -1;
+	  for (sock = 0; sock < syslog_sock_n; ++sock)
+	    {
+	      sl_close_fd(FIL__, __LINE__, syslog_sock[sock]);
+	      syslog_sock[0] = -1;
+	    }
 	}
       SL_RETURN((-1), _("create_syslog_socket"));
@@ -5978,5 +5981,6 @@
   addr.sin_port        = htons(514);
   
-  do_syslog_socket(AF_INET, SOCK_DGRAM, 0, (struct sockaddr *) &addr, addrlen);
+  sock = do_syslog_socket(AF_INET, SOCK_DGRAM, 0, 
+			  (struct sockaddr *) &addr, addrlen);
 
   if (sock >= 0) {
@@ -5991,7 +5995,6 @@
   if (getaddrinfo (NULL, "syslog", &hints, &ai) != 0)
     {
-      errnum = errno;
+      int errnum = errno;
       sh_forward_printerr (_("getaddrinfo"), errnum, 514, __LINE__);
-      sl_close_fd (FIL__, __LINE__, sock);
       SL_RETURN((-1), _("create_syslog_socket"));
     }
@@ -6019,7 +6022,7 @@
     }
   freeaddrinfo (ai);
-#endif
 
  end:
+#endif
   if (syslog_sock_n > 1)
     SH_MINSOCK += (syslog_sock_n - 1);
Index: trunk/src/sh_restrict.c
===================================================================
--- trunk/src/sh_restrict.c	(revision 338)
+++ trunk/src/sh_restrict.c	(revision 341)
@@ -591,6 +591,8 @@
   CuAssertPtrNotNull(tc, sh_restrict_list);
 
+#if !defined(HOST_IS_CYGWIN)
   res = sh_restrict_this("/bin/sh", 1000, 0755, fd);
   CuAssertIntEquals(tc,1,res);
+#endif
 
   sl_close(fd);
