Changeset 1818db29560a5e33de591c5530ccbe1176325fc9

Show
Ignore:
Timestamp:
08/13/09 18:02:51 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1250186571 +0000
git-parent:

[76d9e48076935daad9912f8ada1c5976db8f1e85]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1250186571 +0000
Message:

AF_UNIX socket bind()'ing seems broken because sun_family isn't getting set to AF_UNIX prior to the call to bind()

This causes bind() on unix sockets to fail with EAFNOSUPPORT.

The attached patch fixes this (and fixes a teeny tiny comments typo)

Thanks to Dale Ghent.

closes #165

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_listener.c

    r8fd52de r1818db2  
    244244  if(family == AF_UNIX) { 
    245245    struct stat sb; 
    246     /* unlink the path iff it is a socket */ 
     246    /* unlink the path if it is a socket */ 
    247247    if(stat(host, &sb) == -1) { 
    248248      if(errno != ENOENT) { 
     
    261261      } 
    262262    } 
     263    s.addru.sun_family = AF_UNIX; 
    263264    strncpy(s.addru.sun_path, host, sizeof(s.addru.sun_path)-1); 
    264265    sockaddr_len = sizeof(s.addru);