File: 360-conditional-linux-pid-module.patch

package info (click to toggle)
libapache2-mod-perl2 2.0.9~1624218-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 11,840 kB
  • sloc: perl: 95,064; ansic: 14,522; makefile: 49; sh: 18
file content (27 lines) | stat: -rw-r--r-- 875 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Fallback to use native perl getppid() if Linux::Pid is not present
Author: Guillem Jover <guillem@debian.org>
Origin: vendor
Bug-Debian: http://bugs.debian.org/684290
Forwarded: no
Last-Update: 2014-07-04


--- a/Apache-SizeLimit/lib/Apache/SizeLimit/Core.pm
+++ b/Apache-SizeLimit/lib/Apache/SizeLimit/Core.pm
@@ -139,10 +139,12 @@
         *_platform_getppid = \&_perl_getppid;
     }
     elsif ($Config{'osname'} eq 'linux') {
-        _load('Linux::Pid');
-
-        *_platform_getppid = \&_linux_getppid;
-
+        if (eval { require Linux::Pid }) {
+            *_platform_getppid = \&_linux_getppid;
+        }
+        else {
+            *_platform_getppid = \&_perl_getppid;
+        }
         if (eval { require Linux::Smaps && Linux::Smaps->new($$) }) {
             $USE_SMAPS = 1;
             *_platform_check_size = \&_linux_smaps_size_check;