diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-09-20 21:18:36 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-09-20 21:19:29 +0200 |
| commit | 8cb7d3dcfcbe11a6d5682743816409d1c8e8f6a0 (patch) | |
| tree | 75e6dd62ae61ce7986cf4e0e04e9954586033635 /tools | |
| parent | d606e60dfe3d50499812f7d740dae6e727fa9f76 (diff) | |
all: initial support for fuchsia
Nothing works, but builds.
Update #191
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-execprog/execprog.go | 13 | ||||
| -rw-r--r-- | tools/syz-execprog/execprog_fuchsia.go | 9 | ||||
| -rw-r--r-- | tools/syz-execprog/execprog_linux.go | 23 |
3 files changed, 33 insertions, 12 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go index 282e416e3..9f2c45ba6 100644 --- a/tools/syz-execprog/execprog.go +++ b/tools/syz-execprog/execprog.go @@ -12,11 +12,9 @@ import ( "fmt" "io/ioutil" "os" - "os/signal" "runtime" "sync" "sync/atomic" - "syscall" "time" "github.com/google/syzkaller/pkg/cover" @@ -192,15 +190,6 @@ func main() { }() } - go func() { - c := make(chan os.Signal, 2) - signal.Notify(c, syscall.SIGINT) - <-c - Logf(0, "shutting down...") - atomic.StoreUint32(&shutdown, 1) - <-c - Fatalf("terminating") - }() - + go handleInterrupt(&shutdown) wg.Wait() } diff --git a/tools/syz-execprog/execprog_fuchsia.go b/tools/syz-execprog/execprog_fuchsia.go new file mode 100644 index 000000000..14eac9306 --- /dev/null +++ b/tools/syz-execprog/execprog_fuchsia.go @@ -0,0 +1,9 @@ +// Copyright 2017 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +// +build fuchsia + +package main + +func handleInterrupt(shutdown *uint32) { +} diff --git a/tools/syz-execprog/execprog_linux.go b/tools/syz-execprog/execprog_linux.go new file mode 100644 index 000000000..01e74cec5 --- /dev/null +++ b/tools/syz-execprog/execprog_linux.go @@ -0,0 +1,23 @@ +// Copyright 2017 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package main + +import ( + "os" + "os/signal" + "sync/atomic" + "syscall" + + "github.com/google/syzkaller/pkg/log" +) + +func handleInterrupt(shutdown *uint32) { + c := make(chan os.Signal, 2) + signal.Notify(c, syscall.SIGINT) + <-c + log.Logf(0, "shutting down...") + atomic.StoreUint32(shutdown, 1) + <-c + log.Fatalf("terminating") +} |
