user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] sigfd: fix typos and scoping on systems w/o epoll+kqueue
@ 2020-09-14  3:42 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-09-14  3:42 UTC (permalink / raw)
  To: meta

Unfortunately, I'm not sure how easy catching these at
compile-time, is.  Prototypes do not seem to check these
at compile time when crossing packages (not even with
exported subroutines).
---
 lib/PublicInbox/Daemon.pm | 8 ++++----
 script/public-inbox-watch | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index e5798a4b..b929ec2a 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -75,7 +75,7 @@ sub accept_tls_opt ($) {
 sub daemon_prepare ($) {
 	my ($default_listen) = @_;
 	my $listener_names = {}; # sockname => IO::Handle
-	my $oldset = PublicInbox::Sigfd::block_signals();
+	$oldset = PublicInbox::Sigfd::block_signals();
 	@CMD = ($0, @ARGV);
 	my ($prog) = ($CMD[0] =~ m!([^/]+)\z!g);
 	my $help = <<EOF;
@@ -523,7 +523,7 @@ EOF
 	};
 	my $sigfd = PublicInbox::Sigfd->new($sig, 0);
 	local %SIG = (%SIG, %$sig) if !$sigfd;
-	PublicInbox::restore_signals($oldset) if !$sigfd;
+	PublicInbox::Sigfd::sig_setmask($oldset) if !$sigfd;
 	while (1) { # main loop
 		my $n = scalar keys %pids;
 		unless (@listeners) {
@@ -552,7 +552,7 @@ EOF
 					$pids{$pid} = $i;
 				}
 			}
-			PubliInbox::Sigfd::set_sigmask($oldset) if !$sigfd;
+			PublicInbox::Sigfd::sig_setmask($oldset) if !$sigfd;
 		}
 
 		if ($sigfd) { # Linux and IO::KQueue users:
@@ -640,7 +640,7 @@ sub daemon_loop ($$$$) {
 	if (!$sigfd) {
 		# wake up every second to accept signals if we don't
 		# have signalfd or IO::KQueue:
-		PublicInbox::Sigfd::set_sigmask($oldset);
+		PublicInbox::Sigfd::sig_setmask($oldset);
 		PublicInbox::DS->SetLoopTimeout(1000);
 	}
 	PublicInbox::DS->EventLoop;
diff --git a/script/public-inbox-watch b/script/public-inbox-watch
index 1d164aa3..55183ef2 100755
--- a/script/public-inbox-watch
+++ b/script/public-inbox-watch
@@ -60,7 +60,7 @@ if ($watch) {
 	my $sigfd = PublicInbox::Sigfd->new($sig, $SFD_NONBLOCK);
 	local %SIG = (%SIG, %$sig) if !$sigfd;
 	if (!$sigfd) {
-		PublicInbox::Sigfd::set_sigmask($oldset);
+		PublicInbox::Sigfd::sig_setmask($oldset);
 		PublicInbox::DS->SetLoopTimeout(1000);
 	}
 	$watch->watch($sig, $oldset) while ($watch);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-14  3:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  3:42 [PATCH] sigfd: fix typos and scoping on systems w/o epoll+kqueue Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).