nelhage / reptyr

Reparent a running program to a new terminal
MIT License
5.82k stars 215 forks source link

Return more correct value for get_pgroup #38

Closed worr closed 10 years ago

worr commented 10 years ago

Down the line, the return value of get_pgroup is passed to strerror. As such, it should probably be a proper errno value rather than -1. In cases where someone tries to reparent a non-existant pid, this changes the error message from:

[-] Unable to get pgid (does process 26197 exist?)
Unable to attach to pid 26197: Unknown error -1

to

[-] Unable to get pgid for pid 26197
Unable to attach to pid 26197: No such process

which seems more correct.

nelhage commented 10 years ago

Cool, thanks.