Skip to content

Commit

Permalink
Check blocking variables at release
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jan 11, 2021
1 parent 2748288 commit f017bdf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/etc/etc.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ static VALUE
passwd_ensure(VALUE _)
{
endpwent();
passwd_blocking = 0;
if (RUBY_ATOMIC_EXCHANGE(passwd_blocking, 0) != 1) {
rb_raise(rb_eRuntimeError, "unexpected passwd_blocking");
}
return Qnil;
}

Expand Down Expand Up @@ -495,7 +497,9 @@ static VALUE
group_ensure(VALUE _)
{
endgrent();
group_blocking = 0;
if (RUBY_ATOMIC_EXCHANGE(group_blocking, 0) != 1) {
rb_raise(rb_eRuntimeError, "unexpected group_blocking");
}
return Qnil;
}

Expand Down

0 comments on commit f017bdf

Please sign in to comment.