-#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
- remote_fio_sa.sa_handler = SIG_IGN;
- sigemptyset (&remote_fio_sa.sa_mask);
- remote_fio_sa.sa_flags = 0;
- sigaction (SIGINT, &remote_fio_sa, &remote_fio_osa);
-#else
- remote_fio_ofunc = signal (SIGINT, SIG_IGN);
-#endif
-}
-
-static void
-remote_fileio_sig_set (void (*sigint_func)(int))
-{
-#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
- remote_fio_sa.sa_handler = sigint_func;
- sigemptyset (&remote_fio_sa.sa_mask);
- remote_fio_sa.sa_flags = 0;
- sigaction (SIGINT, &remote_fio_sa, NULL);
-#else
- signal (SIGINT, sigint_func);
-#endif
-}
-
-static void
-remote_fileio_sig_exit (void)
-{
-#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
- sigaction (SIGINT, &remote_fio_osa, NULL);
-#else
- signal (SIGINT, remote_fio_ofunc);
-#endif
-}
-
-static void
-remote_fileio_ctrl_c_signal_handler (int signo)
-{
- remote_fileio_sig_set (remote_fileio_ctrl_c_signal_handler);
- remote_fio_ctrl_c_flag = 1;
- /* Wake up interruptible_select. */
- quit_serial_event_set ();