Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
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
张蕾
Geth-Modification
Commits
863d166c
Commit
863d166c
authored
Sep 26, 2016
by
Felix Lange
Committed by
GitHub
Sep 26, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3043 from fjl/windows-fix-fatalf
cmd/utils: don't check for stderr redirect on windows
parents
61734cc7
b04219fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
cmd.go
cmd/utils/cmd.go
+11
-4
No files found.
cmd/utils/cmd.go
View file @
863d166c
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"os"
"os"
"os/signal"
"os/signal"
"regexp"
"regexp"
"runtime"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
...
@@ -52,10 +53,16 @@ func openLogFile(Datadir string, filename string) *os.File {
...
@@ -52,10 +53,16 @@ func openLogFile(Datadir string, filename string) *os.File {
// is redirected to a different file.
// is redirected to a different file.
func
Fatalf
(
format
string
,
args
...
interface
{})
{
func
Fatalf
(
format
string
,
args
...
interface
{})
{
w
:=
io
.
MultiWriter
(
os
.
Stdout
,
os
.
Stderr
)
w
:=
io
.
MultiWriter
(
os
.
Stdout
,
os
.
Stderr
)
outf
,
_
:=
os
.
Stdout
.
Stat
()
if
runtime
.
GOOS
==
"windows"
{
errf
,
_
:=
os
.
Stderr
.
Stat
()
// The SameFile check below doesn't work on Windows.
if
outf
!=
nil
&&
errf
!=
nil
&&
os
.
SameFile
(
outf
,
errf
)
{
// stdout is unlikely to get redirected though, so just print there.
w
=
os
.
Stderr
w
=
os
.
Stdout
}
else
{
outf
,
_
:=
os
.
Stdout
.
Stat
()
errf
,
_
:=
os
.
Stderr
.
Stat
()
if
outf
!=
nil
&&
errf
!=
nil
&&
os
.
SameFile
(
outf
,
errf
)
{
w
=
os
.
Stderr
}
}
}
fmt
.
Fprintf
(
w
,
"Fatal: "
+
format
+
"
\n
"
,
args
...
)
fmt
.
Fprintf
(
w
,
"Fatal: "
+
format
+
"
\n
"
,
args
...
)
logger
.
Flush
()
logger
.
Flush
()
...
...
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