cvs commit: ALFS/nALFS/src comm.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Tue Feb 10 19:43:59 PST 2004


kpfleming    04/02/10 20:43:59

  Modified:    nALFS/src comm.c
  Log:
  add more descriptive error message for when socketpair() fails because the running kernel does not support UNIX domain sockets
  
  Revision  Changes    Path
  1.9       +10 -2     ALFS/nALFS/src/comm.c
  
  Index: comm.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/comm.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- comm.c	3 Nov 2003 21:45:04 -0000	1.8
  +++ comm.c	11 Feb 2004 03:43:59 -0000	1.9
  @@ -428,10 +428,18 @@
   void comm_create_socket_pairs(void)
   {
   	if (socketpair(PF_UNIX, SOCK_STREAM, 0, data_sock) == -1) {
  -		Fatal_error("socketpair() failed: %s", strerror(errno));
  +		if (errno == EAFNOSUPPORT) {
  +			Fatal_error("Your kernel does not support UNIX domain sockets.");
  +		} else {
  +			Fatal_error("socketpair() failed: %s", strerror(errno));
  +		}
   	}
   	if (socketpair(PF_UNIX, SOCK_STREAM, 0, ctrl_sock) == -1) {
  -		Fatal_error("socketpair() failed: %s", strerror(errno));
  +		if (errno == EAFNOSUPPORT) {
  +			Fatal_error("Your kernel does not support UNIX domain sockets.");
  +		} else {
  +			Fatal_error("socketpair() failed: %s", strerror(errno));
  +		}
   	}
   
   	/* Non-blocking reading for our data socket. */
  
  
  



More information about the alfs-log mailing list