Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SIGTERM/SIGINT handling #72

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions rngd.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ int kent_pool_size;
bool am_daemon; /* True if we went daemon */
bool msg_squash = false; /* True if we want no messages on the console */
bool quiet = false; /* True if we want no console output at all */
volatile bool server_running = true; /* set to false, to stop daemon */

bool ignorefail = false; /* true if we ignore MAX_RNG_FAILURES */

Expand Down Expand Up @@ -542,8 +541,6 @@ static int update_kernel_random(struct rng *rng, int random_step,

for (p = buf; p + random_step <= &buf[FIPS_RNG_BUFFER_SIZE];
p += random_step) {
if (!server_running)
return 0;
rc = random_add_entropy(p, random_step);
if (rc == -1)
return 1;
Expand Down Expand Up @@ -612,9 +609,6 @@ static void do_loop(int random_step)
continue;

retry_same:
if (!server_running)
return;

if (iter->disabled)
continue; /* failed, no work */

Expand Down Expand Up @@ -682,11 +676,6 @@ static void do_loop(int random_step)
"No entropy sources working, exiting rngd\n");
}

static void term_signal(int signo)
{
server_running = false;
}

static void alarm_signal(int signo)
{
double bits_gathered;
Expand Down Expand Up @@ -824,11 +813,6 @@ int main(int argc, char **argv)
signal(SIGHUP, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
}
/*
* We always catch these to ensure that we gracefully shutdown
*/
signal(SIGINT, term_signal);
signal(SIGTERM, term_signal);
if (arguments->test) {
message(LOG_CONS|LOG_INFO, "Entering test mode...no entropy will "
"be delivered to the kernel\n");
Expand Down