justmao945 / mallory

HTTP/HTTPS proxy over SSH
MIT License
319 stars 69 forks source link

In win7 go get issue #6

Closed taolinke closed 9 years ago

taolinke commented 9 years ago

$ go get github.com/justmao945/mallory/cmd/mallory

github.com/justmao945/mallory

D:\tass\go-language\work\src\github.com\justmao945\mallory\util.go:58: undefined : syscall.SYS_IOCTL D:\tass\go-language\work\src\github.com\justmao945\mallory\util.go:58: not enoug h arguments in call to syscall.Syscall D:\tass\go-language\work\src\github.com\justmao945\mallory\util.go:72: undefined : syscall.TIOCGPGRP

taolinke commented 9 years ago

PS. $ go version go version go1.3.1 windows/amd64

justmao945 commented 9 years ago

@taolinke I'll give a fix tonight, or you can comment out error lines by yourself if you want to fix it as soon as possible. Thank you.

  1. clone the repository into $GOPATH/src/github.com/justmao945/mallory
  2. comment out lines in file github.com\justmao945\mallory\util.go
// POSIX ioctl syscall
// From https://github.com/mreiferson/go-simplelog/blob/master/simplelog.go
/*
func Ioctl(fd, request, argp uintptr) syscall.Errno {
    _, _, errorp := syscall.Syscall(syscall.SYS_IOCTL, fd, request, argp)
    return errorp
}
*/
// Test is a termnial or not
// From https://github.com/mreiferson/go-simplelog/blob/master/simplelog.go
func Isatty(f *os.File) bool {
    /*
    switch runtime.GOOS {
    case "darwin":
    case "linux":
    default:
        return false
    }
        var t [2]byte
    errno := Ioctl(f.Fd(), syscall.TIOCGPGRP, uintptr(unsafe.Pointer(&t)))
    return errno == 0
        */
        return false;
}
  1. run go install github.com/justmao945/mallory/cmd/mallory