[LON-CAPA-cvs] cvs: loncom(version_2_10_X) / lond

raeburn raeburn@source.lon-capa.org
Tue, 05 Apr 2011 15:49:27 -0000


raeburn		Tue Apr  5 15:49:27 2011 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom	lond 
  Log:
  - Backport 1.468, 1.469.
  
  
Index: loncom/lond
diff -u loncom/lond:1.467.2.1 loncom/lond:1.467.2.2
--- loncom/lond:1.467.2.1	Tue Jan 25 09:39:42 2011
+++ loncom/lond	Tue Apr  5 15:49:27 2011
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.467.2.1 2011/01/25 09:39:42 raeburn Exp $
+# $Id: lond,v 1.467.2.2 2011/04/05 15:49:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -58,7 +58,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.467.2.1 $'; #' stupid emacs
+my $VERSION='$Revision: 1.467.2.2 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -5999,7 +5999,7 @@
 $server = IO::Socket::INET->new(LocalPort => $perlvar{'londPort'},
                                 Type      => SOCK_STREAM,
                                 Proto     => 'tcp',
-                                Reuse     => 1,
+                                ReuseAddr => 1,
                                 Listen    => 10 )
   or die "making socket: $@\n";
 
@@ -6396,6 +6396,14 @@
                                 #don't get intercepted
         $SIG{USR1}= \&logstatus;
         $SIG{ALRM}= \&timeout;
+
+        #
+        # Block sigpipe as it gets thrownon socket disconnect and we want to
+        # deal with that as a read faiure instead.
+        #
+        my $blockset = POSIX::SigSet->new(SIGPIPE);
+        sigprocmask(SIG_BLOCK, $blockset);
+
         $lastlog='Forked ';
         $status='Forked';