to remove stuff after #endif to avoid RCS problems with patches (hi christos!).
- exit with the child's exit value and with non zero on error
- modernize - use termios