[Nagios-checkins] ndoutils/src ndo2db.c,1.20,1.21

Duncan Ferguson duncan_ferguson at users.sourceforge.net
Thu Aug 6 14:32:41 UTC 2009


Update of /cvsroot/nagios/ndoutils/src
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24699/src

Modified Files:
	ndo2db.c 
Log Message:
Fix for Solaris 10 which gets an EINTR on accept for the 2nd file2sock call (Opsera Ltd)


Index: ndo2db.c
===================================================================
RCS file: /cvsroot/nagios/ndoutils/src/ndo2db.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** ndo2db.c	6 Aug 2009 13:43:49 -0000	1.20
--- ndo2db.c	6 Aug 2009 14:32:39 -0000	1.21
***************
*** 809,817 ****
  	while(1){
  
! 		if((new_sd=accept(ndo2db_sd,(ndo2db_socket_type==NDO_SINK_TCPSOCKET)?(struct sockaddr *)&client_address_i:(struct sockaddr *)&client_address_u,(socklen_t *)&client_address_length))<0){
! 			perror("Accept error");
! 			ndo2db_cleanup_socket();
! 			return NDO_ERROR;
! 		        }
  
  #ifndef DEBUG_NDO2DB
--- 809,831 ----
  	while(1){
  
! 		/* 
! 		Solaris 10 gets an EINTR error when file2sock invoked on the 2nd call
! 		An alternative fix is not to fork below, but this has wider implications
! 		*/
! 		while(1) {
! 			new_sd=accept(ndo2db_sd,(ndo2db_socket_type==NDO_SINK_TCPSOCKET)?(struct sockaddr *)&client_address_i:(struct sockaddr *)&client_address_u,(socklen_t *)&client_address_length);
! 			if(new_sd>=0)
! 				/* data available */
! 				break;
! 			if(errno == EINTR) {
! 				/* continue */
! 				} 
! 			else {
! 				perror("Accept error");
! 				ndo2db_cleanup_socket();
! 				return NDO_ERROR;
! 				}
! 			}
! 
  
  #ifndef DEBUG_NDO2DB





More information about the Nagios-commits mailing list