* [PATCH 1/3] daemon: use POSIX and WNOHANG more idiomatically
2019-07-08 7:39 5% [PATCH 0/3] a few minor cleanups Eric Wong
@ 2019-07-08 7:39 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-07-08 7:39 UTC (permalink / raw)
To: meta
No point in uglifying our code since we need the POSIX
module in many places, anyways.
---
lib/PublicInbox/Daemon.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index 2046a7f5..6cb3a0ca 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -8,6 +8,7 @@ use warnings;
use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
use IO::Handle;
use IO::Socket;
+use POSIX qw(WNOHANG);
use Socket qw(IPPROTO_TCP SOL_SOCKET);
sub SO_ACCEPTFILTER () { 0x1000 }
use Cwd qw/abs_path/;
@@ -15,7 +16,6 @@ STDOUT->autoflush(1);
STDERR->autoflush(1);
use PublicInbox::DS qw(now);
require PublicInbox::EvCleanup;
-require POSIX;
require PublicInbox::Listener;
require PublicInbox::ParentPipe;
my @CMD;
@@ -437,7 +437,7 @@ sub upgrade_aborted ($) {
sub reap_children () {
while (1) {
- my $p = waitpid(-1, &POSIX::WNOHANG) or return;
+ my $p = waitpid(-1, WNOHANG) or return;
if (defined $reexec_pid && $p == $reexec_pid) {
upgrade_aborted($p);
} elsif (defined(my $id = delete $pids{$p})) {
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/3] a few minor cleanups
@ 2019-07-08 7:39 5% Eric Wong
2019-07-08 7:39 7% ` [PATCH 1/3] daemon: use POSIX and WNOHANG more idiomatically Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-07-08 7:39 UTC (permalink / raw)
To: meta
Just some minor things to make the code more pleasant
and less error-prone.
Eric Wong (3):
daemon: use POSIX and WNOHANG more idiomatically
httpd: (cleanup) use reference instead of *glob
http|nntp: "use PublicInbox::DS" instead of ->import
lib/PublicInbox/Daemon.pm | 4 ++--
lib/PublicInbox/HTTP.pm | 2 +-
lib/PublicInbox/HTTPD.pm | 5 +----
lib/PublicInbox/NNTP.pm | 2 +-
4 files changed, 5 insertions(+), 8 deletions(-)
--
EW
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-07-08 7:39 5% [PATCH 0/3] a few minor cleanups Eric Wong
2019-07-08 7:39 7% ` [PATCH 1/3] daemon: use POSIX and WNOHANG more idiomatically 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).