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
be528ae9
Commit
be528ae9
authored
Dec 16, 2017
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os: pass -s to hostname on AIX
Reviewed-on:
https://go-review.googlesource.com/79375
From-SVN: r255738
parent
fe6272cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
gcc/go/gofrontend/MERGE
+1
-1
libgo/go/os/os_test.go
+9
-3
No files found.
gcc/go/gofrontend/MERGE
View file @
be528ae9
d1f90c9b77baca5c33a398ab844fb4440c6a5ee
7
97eb3f61cf1c2cc01b9db6ed20e39bc04573c20
7
The first line of this file holds the git revision number of the last
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
merge done from the gofrontend repository.
libgo/go/os/os_test.go
View file @
be528ae9
...
@@ -1440,7 +1440,7 @@ func TestOpenNoName(t *testing.T) {
...
@@ -1440,7 +1440,7 @@ func TestOpenNoName(t *testing.T) {
}
}
}
}
func
runBinHostname
(
t
*
testing
.
T
)
string
{
func
runBinHostname
(
t
*
testing
.
T
,
argv
[]
string
)
string
{
// Run /bin/hostname and collect output.
// Run /bin/hostname and collect output.
r
,
w
,
err
:=
Pipe
()
r
,
w
,
err
:=
Pipe
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -1448,7 +1448,7 @@ func runBinHostname(t *testing.T) string {
...
@@ -1448,7 +1448,7 @@ func runBinHostname(t *testing.T) string {
}
}
defer
r
.
Close
()
defer
r
.
Close
()
const
path
=
"/bin/hostname"
const
path
=
"/bin/hostname"
p
,
err
:=
StartProcess
(
path
,
[]
string
{
"hostname"
}
,
&
ProcAttr
{
Files
:
[]
*
File
{
nil
,
w
,
Stderr
}})
p
,
err
:=
StartProcess
(
path
,
argv
,
&
ProcAttr
{
Files
:
[]
*
File
{
nil
,
w
,
Stderr
}})
if
err
!=
nil
{
if
err
!=
nil
{
if
_
,
err
:=
Stat
(
path
);
IsNotExist
(
err
)
{
if
_
,
err
:=
Stat
(
path
);
IsNotExist
(
err
)
{
t
.
Skipf
(
"skipping test; test requires %s but it does not exist"
,
path
)
t
.
Skipf
(
"skipping test; test requires %s but it does not exist"
,
path
)
...
@@ -1514,7 +1514,13 @@ func TestHostname(t *testing.T) {
...
@@ -1514,7 +1514,13 @@ func TestHostname(t *testing.T) {
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"%v"
,
err
)
t
.
Fatalf
(
"%v"
,
err
)
}
}
want
:=
runBinHostname
(
t
)
var
want
string
if
runtime
.
GOOS
==
"aix"
{
want
=
runBinHostname
(
t
,
[]
string
{
"hostname"
,
"-s"
})
}
else
{
want
=
runBinHostname
(
t
,
[]
string
{
"hostname"
})
}
if
hostname
!=
want
{
if
hostname
!=
want
{
i
:=
strings
.
Index
(
hostname
,
"."
)
i
:=
strings
.
Index
(
hostname
,
"."
)
if
i
<
0
||
hostname
[
0
:
i
]
!=
want
{
if
i
<
0
||
hostname
[
0
:
i
]
!=
want
{
...
...
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