Skip to content

Commit e6fface

Browse files
committed
remove comments, remove unused/obsolete files
Signed-off-by: leongross <[email protected]>
1 parent 64060ec commit e6fface

File tree

5 files changed

+9
-31
lines changed

5 files changed

+9
-31
lines changed

src/os/exec_linux_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestForkExec(t *testing.T) {
1818
return
1919
}
2020

21-
proc, err := StartProcess("echo", []string{"/bin/echo", "hello", "world"}, &ProcAttr{})
21+
proc, err := StartProcess("/bin/echo", []string{"hello", "world"}, &ProcAttr{})
2222
if !errors.Is(err, nil) {
2323
t.Fatalf("forkExec failed: %v", err)
2424
}
@@ -28,12 +28,15 @@ func TestForkExec(t *testing.T) {
2828
}
2929
t.Logf("forkExec succeeded: new process has pid %d", proc)
3030

31-
proc, err = StartProcess("invalid", []string{"/bin/nonexistent"}, &ProcAttr{})
32-
if errors.Is(err, nil) {
33-
t.Fatalf("wanted err, got nil")
31+
}
32+
33+
func TestForkExecInvalid(t *testing.T) {
34+
proc, err := StartProcess("invalid", []string{"invalid"}, &ProcAttr{})
35+
if !errors.Is(err, ErrNotExist) {
36+
t.Fatalf("wanted ErrNotExist, got %s\n", err)
3437
}
3538

36-
if proc.Pid != 0 {
37-
t.Fatalf("wanted 0, got %v", proc.Pid)
39+
if proc != nil {
40+
t.Fatalf("wanted nil, got %v\n", proc)
3841
}
3942
}

src/os/os.test

1.88 MB
Binary file not shown.

src/os/osexec.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ func execve(pathname string, argv []string, envv []string) error {
4040

4141
ret, _, err := syscall.Syscall(syscall.SYS_EXECVE, uintptr(unsafe.Pointer(&argv0[0])), uintptr(unsafe.Pointer(&argv1[0])), uintptr(unsafe.Pointer(&env1[0])))
4242
if int(ret) != 0 {
43-
// errno := err.(syscall.Errno)
44-
// return errno
4543
return err
4644
}
4745

src/os/signal/signal.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/syscall/exec_unix.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)