Skip to content

Commit

Permalink
Initialize signal sets with sigemptyset
Browse files Browse the repository at this point in the history
  • Loading branch information
horta committed Feb 9, 2024
1 parent 97ba72d commit d5c791b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions c-core/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ int scan_run(struct scan *x, char const *product_dir)
if ((rc = product_open(&x->product, num_threads, product_dir)))
defer_return(rc);

sigset_t old_mask = 0;
sigset_t new_mask = 0;
sigset_t old_mask;
sigset_t new_mask;
sigemptyset(&new_mask);
sigaddset(&new_mask, SIGINT);
sigaddset(&new_mask, SIGTERM);
Expand Down
5 changes: 3 additions & 2 deletions c-core/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void thread_init(struct thread *x)
chararray_init(&x->amino);
hmmer_init(&x->hmmer);
x->path = imm_path();
x->signal_mask = 0;
sigemptyset(&x->signal_mask);
x->interrupted = false;
}

Expand Down Expand Up @@ -84,7 +84,8 @@ int thread_run(struct thread *x, struct sequence_queue const *sequences,
int *done_proteins)
{
int rc = 0;
sigset_t sigpend = 0;
sigset_t sigpend;
sigemptyset(&sigpend);
int signal = 0;

struct protein_iter *protein_iter = &x->iter;
Expand Down

0 comments on commit d5c791b

Please sign in to comment.