about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-12-20T13·18+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-12-20T13·18+0100
commitb352fe2775d09993add893ebff8c0c4c8369182a (patch)
treef402536cd3c01023baa56dbb03866aed759bca50 /scripts
parent8931bf7168cbbc6a078bed6486b8081652663836 (diff)
Revert "Scan /proc/<pid>/cmdline for GC roots"
This reverts commit 194e3374b89b8b2dec6296923877304bdb5c6ae2.
Checking the command line for GC roots means that

  $ nix-store --delete $path

will fail because $path is now a root because it's mentioned on the
command line.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/find-runtime-roots.pl.in12
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/find-runtime-roots.pl.in b/scripts/find-runtime-roots.pl.in
index 2e04a635e8..e1a2dde556 100755
--- a/scripts/find-runtime-roots.pl.in
+++ b/scripts/find-runtime-roots.pl.in
@@ -15,6 +15,8 @@ sub readProc {
 
         my $process = "/proc/$name";
 
+        #print STDERR "=== $process\n";
+
         my $target;
         print "$target\n" if $target = readlink "$process/exe";
         print "$target\n" if $target = readlink "$process/cwd";
@@ -36,17 +38,11 @@ sub readProc {
         }
 
         # Get all store paths that appear in the environment of this process.
-        my $re = "\Q$Nix::Config::storeDir\E\/[0-9a-z]+[0-9a-zA-Z\+\-\._\?=]*";
         eval {
             my $env = Nix::Utils::readFile "$process/environ";
-            my @matches = $env =~ /$re/g;
-            print "$_\n" foreach @matches;
-        };
-        eval {
-            my $cmdline = Nix::Utils::readFile "$process/cmdline";
-            my @matches = $cmdline =~ /$re/g;
+            my @matches = $env =~ /\Q$Nix::Config::storeDir\E\/[0-9a-z]+[0-9a-zA-Z\+\-\._\?=]*/g;
             print "$_\n" foreach @matches;
-        };
+        }
     }
 
     closedir DIR;