Move handle_signals() to before the FD_SETs.  handle_signals() may result in a our modem closing after it's made its way into the fd_set, resulting in a program exit (with select(): bad file descriptor) rather than a dropped link.
Move handle_signals() to before the FD_SETs.  handle_signals()
may result in a our modem closing after it's made its way into
the fd_set, resulting in a program exit (with select(): bad file
descriptor) rather than a dropped link.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase