Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1248)

Side by Side Diff: src/cmd/go/signal.go

Issue 6903061: code review 6903061: cmd/go: handle os signals (Closed)
Patch Set: diff -r 3c932286e5f5 https://go.googlecode.com/hg/ Created 11 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/cmd/go/run.go ('k') | src/cmd/go/signal_notunix.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package main
6
7 import (
8 "fmt"
9 "os"
10 "os/signal"
11 "sync"
12 )
13
14 // ignoreSignals setup for some signals to be ignored.
15 func ignoreSignals() {
16 sig := make(chan os.Signal)
17 signal.Notify(sig, signalsToIgnore...)
18 go func() {
19 for s := range sig {
20 fmt.Fprintf(os.Stderr, "\n%s: %s received, ignoring\n", os.Args[0], s)
rsc 2012/12/10 06:41:16 I don't think anything needs to be printed. On Un
brainman 2012/12/11 06:25:42 ^C goes to "process group", and go process ignores
21 }
22 }()
23 }
24
25 var onceIgnoreSignals sync.Once
26
27 // startSigHandlers start signal handlers.
28 func startSigHandlers() {
29 onceIgnoreSignals.Do(ignoreSignals)
30 }
OLDNEW
« no previous file with comments | « src/cmd/go/run.go ('k') | src/cmd/go/signal_notunix.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b