Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
40ff695f
Commit
40ff695f
authored
Nov 24, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: Fix handling of Unix domain @ addresses.
From-SVN: r193783
parent
f246eadc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
libgo/go/syscall/socket.go
+5
-1
libgo/go/syscall/socket_linux.go
+1
-1
No files found.
libgo/go/syscall/socket.go
View file @
40ff695f
...
...
@@ -87,12 +87,16 @@ func (sa *SockaddrUnix) sockaddr() (*RawSockaddrAny, Socklen_t, error) {
for
i
:=
0
;
i
<
n
;
i
++
{
sa
.
raw
.
Path
[
i
]
=
int8
(
name
[
i
])
}
// length is family (uint16), name, NUL.
sl
:=
2
+
Socklen_t
(
n
)
+
1
if
sa
.
raw
.
Path
[
0
]
==
'@'
{
sa
.
raw
.
Path
[
0
]
=
0
// Don't count trailing NUL for abstract address.
sl
--
}
// length is family (uint16), name, NUL.
return
(
*
RawSockaddrAny
)(
unsafe
.
Pointer
(
&
sa
.
raw
)),
2
+
Socklen_t
(
n
)
+
1
,
nil
return
(
*
RawSockaddrAny
)(
unsafe
.
Pointer
(
&
sa
.
raw
)),
sl
,
nil
}
func
anyToSockaddr
(
rsa
*
RawSockaddrAny
)
(
Sockaddr
,
error
)
{
...
...
libgo/go/syscall/socket_linux.go
View file @
40ff695f
...
...
@@ -103,7 +103,7 @@ func (sa *RawSockaddrUnix) getLen() (int, error) {
// to be uninterpreted fixed-size binary blobs--but
// everyone uses this convention.
n
:=
0
for
n
<
len
(
sa
.
Path
)
-
3
&&
sa
.
Path
[
n
]
!=
0
{
for
n
<
len
(
sa
.
Path
)
&&
sa
.
Path
[
n
]
!=
0
{
n
++
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment