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
705beb4c
Commit
705beb4c
authored
May 27, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/utils: print errors only once if stdout and stderr are the same file
parent
74706a0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
cmd.go
cmd/utils/cmd.go
+10
-3
No files found.
cmd/utils/cmd.go
View file @
705beb4c
...
...
@@ -125,10 +125,17 @@ func initDataDir(Datadir string) {
}
}
// Fatalf formats a message to standard output and exits the program.
// Fatalf formats a message to standard error and exits the program.
// The message is also printed to standard output if standard error
// is redirected to a different file.
func
Fatalf
(
format
string
,
args
...
interface
{})
{
fmt
.
Fprintf
(
os
.
Stderr
,
"Fatal: "
+
format
+
"
\n
"
,
args
...
)
fmt
.
Fprintf
(
os
.
Stdout
,
"Fatal: "
+
format
+
"
\n
"
,
args
...
)
w
:=
io
.
MultiWriter
(
os
.
Stdout
,
os
.
Stderr
)
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
...
)
logger
.
Flush
()
os
.
Exit
(
1
)
}
...
...
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