Skip to content

Commit

Permalink
remove comments, remove unused/obsolete files
Browse files Browse the repository at this point in the history
Signed-off-by: leongross <leon.gross@9elements.com>
  • Loading branch information
leongross committed Oct 28, 2024
1 parent 64060ec commit e6fface
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 31 deletions.
15 changes: 9 additions & 6 deletions src/os/exec_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestForkExec(t *testing.T) {
return
}

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

proc, err = StartProcess("invalid", []string{"/bin/nonexistent"}, &ProcAttr{})
if errors.Is(err, nil) {
t.Fatalf("wanted err, got nil")
}

func TestForkExecInvalid(t *testing.T) {
proc, err := StartProcess("invalid", []string{"invalid"}, &ProcAttr{})
if !errors.Is(err, ErrNotExist) {
t.Fatalf("wanted ErrNotExist, got %s\n", err)
}

if proc.Pid != 0 {
t.Fatalf("wanted 0, got %v", proc.Pid)
if proc != nil {
t.Fatalf("wanted nil, got %v\n", proc)
}
}
Binary file added src/os/os.test
Binary file not shown.
2 changes: 0 additions & 2 deletions src/os/osexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ func execve(pathname string, argv []string, envv []string) error {

ret, _, err := syscall.Syscall(syscall.SYS_EXECVE, uintptr(unsafe.Pointer(&argv0[0])), uintptr(unsafe.Pointer(&argv1[0])), uintptr(unsafe.Pointer(&env1[0])))
if int(ret) != 0 {
// errno := err.(syscall.Errno)
// return errno
return err
}

Expand Down
16 changes: 0 additions & 16 deletions src/os/signal/signal.go

This file was deleted.

7 changes: 0 additions & 7 deletions src/syscall/exec_unix.go

This file was deleted.

0 comments on commit e6fface

Please sign in to comment.