Changeset 1818db29560a5e33de591c5530ccbe1176325fc9
- Timestamp:
- 08/13/09 18:02:51
(4 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
| r8fd52de |
r1818db2 |
|
| 244 | 244 | if(family == AF_UNIX) { |
|---|
| 245 | 245 | struct stat sb; |
|---|
| 246 | | /* unlink the path iff it is a socket */ |
|---|
| | 246 | /* unlink the path if it is a socket */ |
|---|
| 247 | 247 | if(stat(host, &sb) == -1) { |
|---|
| 248 | 248 | if(errno != ENOENT) { |
|---|
| … | … | |
| 261 | 261 | } |
|---|
| 262 | 262 | } |
|---|
| | 263 | s.addru.sun_family = AF_UNIX; |
|---|
| 263 | 264 | strncpy(s.addru.sun_path, host, sizeof(s.addru.sun_path)-1); |
|---|
| 264 | 265 | sockaddr_len = sizeof(s.addru); |
|---|