Newer
Older
Daniel Stenberg
committed
else
logmsg("Listening on port %hu", port);
Daniel Stenberg
committed
wrotepidfile = write_pidfile(pidname);
if(!wrotepidfile)
goto sockfilt_cleanup;
do {
juggle_again = juggle(&msgsock, sock, &mode);
} while(juggle_again);
Daniel Stenberg
committed
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);
}
Daniel Stenberg
committed
logmsg("============> sockfilt quits");