Skip to content
sockfilt.c 27.3 KiB
Newer Older
  wrotepidfile = write_pidfile(pidname);
  if(!wrotepidfile)
    goto sockfilt_cleanup;
Yang Tse's avatar
 
Yang Tse committed
  do {
    juggle_again = juggle(&msgsock, sock, &mode);
  } while(juggle_again);
sockfilt_cleanup:

  if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD))
    sclose(msgsock);

  if(sock != CURL_SOCKET_BAD)
    unlink(pidname);

  restore_signal_handlers();

  if(got_exit_signal) {
    logmsg("============> sockfilt exits with signal (%d)", exit_signal);
    /*
     * To properly set the return status of the process we
     * must raise the same signal SIGINT or SIGTERM that we
     * caught and let the old handler take care of it.
     */
    raise(exit_signal);
  }
  logmsg("============> sockfilt quits");