From 57b18b44e1770b163aba55eacf53195a8305398e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 May 2016 05:27:06 +0000 Subject: localize $/ in more places to avoid potential problems This hopefully makes the intent of the code clearer, too. The the HTTP use of the numeric reference for getline caused problems in Git.pm, already. --- lib/PublicInbox/Daemon.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox/Daemon.pm') diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 8de7ff24..dc810106 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -350,6 +350,7 @@ sub unlink_pid_file_safe_ish ($$) { return unless defined $unlink_pid && $unlink_pid == $$; open my $fh, '<', $file or return; + local $/ = "\n"; defined(my $read_pid = <$fh>) or return; chomp $read_pid; if ($read_pid == $unlink_pid) { -- cgit v1.2.3-24-ge0c7