(pid uint, shell string)
| 26 | } |
| 27 | |
| 28 | func shellApiAttachMain(pid uint, shell string) { |
| 29 | config, err := server.DefaultConfiguration() |
| 30 | if err != nil { |
| 31 | fatal(err) |
| 32 | } |
| 33 | |
| 34 | // Trying to daemonize. |
| 35 | err = daemonize(&config) |
| 36 | verifyFatal(err) |
| 37 | |
| 38 | client, err := server.NewClient(config) |
| 39 | if err != nil { |
| 40 | fatal(err) |
| 41 | } |
| 42 | |
| 43 | rsp := server.AttachResponse{} |
| 44 | req := server.AttachRequest{ |
| 45 | Pid: int(pid), |
| 46 | Shell: shell, |
| 47 | CodBinaryPath: CodBinaryPath, |
| 48 | } |
| 49 | |
| 50 | err = client.Request(&req, &rsp) |
| 51 | if err != nil { |
| 52 | fatal(err) |
| 53 | } |
| 54 | } |
no test coverage detected