]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Daemon.pm
daemon: unlink .oldbin PID file correctly
[public-inbox.git] / lib / PublicInbox / Daemon.pm
index 3d582e355ed70d40f6b9689f791f5e08f0c81d67..4ff7cad493990d81c6ce4d2e896f63cfe7a87032 100644 (file)
@@ -247,7 +247,7 @@ sub daemonize () {
 
        write_pid($pid_file);
        # for ->DESTROY:
-       bless { pid => $$, pid_file => $pid_file }, __PACKAGE__;
+       bless { pid => $$, pid_file => \$pid_file }, __PACKAGE__;
 }
 
 sub worker_quit { # $_[0] = signal name or number (unused)
@@ -663,7 +663,7 @@ sub write_pid ($) {
 }
 
 sub DESTROY {
-       unlink_pid_file_safe_ish($_[0]->{pid}, $_[0]->{pid_file});
+       unlink_pid_file_safe_ish($_[0]->{pid}, ${$_[0]->{pid_file}});
 }
 
 1;