Skip to content
Snippets Groups Projects
Commit b352fe27 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

Revert "Scan /proc/<pid>/cmdline for GC roots"

This reverts commit 194e3374.
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.
parent 8931bf71
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment