mirror of
https://github.com/reactos/syzkaller.git
synced 2024-10-07 09:03:28 +00:00
pkg/osutil: remove appengine tag
Appengine doesn't provide appengine tag anymore. Resort to use of syscall package for ExitStatus instead.
This commit is contained in:
parent
4e3820bfb2
commit
36db93ffb9
@ -10,6 +10,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -61,10 +62,16 @@ func Run(timeout time.Duration, cmd *exec.Cmd) ([]byte, error) {
|
||||
if <-timedout {
|
||||
text = fmt.Sprintf("timedout %q", cmd.Args)
|
||||
}
|
||||
exitCode := 0
|
||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||
if status, ok := exitErr.Sys().(syscall.WaitStatus); ok {
|
||||
exitCode = status.ExitStatus()
|
||||
}
|
||||
}
|
||||
return output.Bytes(), &VerboseError{
|
||||
Title: text,
|
||||
Output: output.Bytes(),
|
||||
ExitCode: exitCode(err),
|
||||
ExitCode: exitCode,
|
||||
}
|
||||
}
|
||||
return output.Bytes(), nil
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 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 akaros,!appengine
|
||||
// +build akaros
|
||||
|
||||
package osutil
|
||||
|
||||
|
@ -1,31 +0,0 @@
|
||||
// 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 appengine
|
||||
|
||||
package osutil
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func Sandbox(cmd *exec.Cmd, user, net bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func SandboxChown(file string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func setPdeathsig(cmd *exec.Cmd) {
|
||||
}
|
||||
|
||||
func killPgroup(cmd *exec.Cmd) {
|
||||
}
|
||||
|
||||
func exitCode(err error) int {
|
||||
// We are stuck on Go 1.11 on appengine.
|
||||
// 1.11 does not have ProcessState.ExitCode.
|
||||
// Once we upgrade to 1.12, we should remove this.
|
||||
return 0
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
// 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 freebsd,!appengine netbsd,!appengine openbsd,!appengine
|
||||
// +build freebsd netbsd openbsd
|
||||
|
||||
package osutil
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
// 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 !appengine
|
||||
|
||||
package osutil
|
||||
|
||||
import (
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 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,!appengine
|
||||
// +build fuchsia
|
||||
|
||||
package osutil
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
// 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 !appengine
|
||||
|
||||
package osutil
|
||||
|
||||
import (
|
||||
|
@ -1,17 +0,0 @@
|
||||
// Copyright 2020 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 !appengine
|
||||
|
||||
package osutil
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func exitCode(err error) int {
|
||||
if exitError, ok := err.(*exec.ExitError); ok {
|
||||
return exitError.ProcessState.ExitCode()
|
||||
}
|
||||
return 0
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
// 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 freebsd,!appengine netbsd,!appengine openbsd,!appengine linux,!appengine darwin,!appengine
|
||||
// +build freebsd netbsd openbsd linux darwin
|
||||
|
||||
package osutil
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
// 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 !appengine
|
||||
|
||||
package osutil
|
||||
|
||||
import (
|
||||
|
Loading…
Reference in New Issue
Block a user