Skip to content

Commit 2153e0d

Browse files
committed
Moved the ErrProcessDone variable to common place and removed duplicates
Signed-off-by: Alwin Doss <[email protected]>
1 parent 44b2bd8 commit 2153e0d

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

src/os/exec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package os
66

77
import (
8+
"errors"
89
"internal/testlog"
910
"runtime"
1011
"sync"
@@ -13,6 +14,9 @@ import (
1314
"time"
1415
)
1516

17+
// ErrProcessDone indicates a Process has finished.
18+
var ErrProcessDone = errors.New("os: process already finished")
19+
1620
// Process stores the information about a process created by StartProcess.
1721
type Process struct {
1822
Pid int

src/os/exec_plan9.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package os
66

77
import (
8-
"errors"
98
"runtime"
109
"syscall"
1110
"time"
@@ -50,9 +49,6 @@ func (p *Process) writeProcFile(file string, data string) error {
5049
return e
5150
}
5251

53-
// ErrProcessDone indicates a Process has finished.
54-
var ErrProcessDone = errors.New("os: process already finished")
55-
5652
func (p *Process) signal(sig Signal) error {
5753
if p.done() {
5854
return ErrProcessDone

src/os/exec_unix.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ func (p *Process) wait() (ps *ProcessState, err error) {
5959
return ps, nil
6060
}
6161

62-
// ErrProcessDone indicates a Process has finished.
63-
var ErrProcessDone = errors.New("os: process already finished")
64-
6562
func (p *Process) signal(sig Signal) error {
6663
if p.Pid == -1 {
6764
return errors.New("os: process already released")

src/os/exec_windows.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ func terminateProcess(pid, exitcode int) error {
5555
return NewSyscallError("TerminateProcess", e)
5656
}
5757

58-
// ErrProcessDone indicates a Process has finished.
59-
var ErrProcessDone = errors.New("os: process already finished")
60-
6158
func (p *Process) signal(sig Signal) error {
6259
handle := atomic.LoadUintptr(&p.handle)
6360
if handle == uintptr(syscall.InvalidHandle) {

0 commit comments

Comments
 (0)