reduce syntactic complexity - these don't need to be void
try to limit scope of globals
kill file transfer if writing fails
wrong signal