From 1d487dc6a682468ae00402b3720ff412b6bfb6fc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 5 Mar 2012 19:19:29 +0100 Subject: nix-worker: put the pid of the caller in argv[1] This is useful for debugging. --- src/libmain/shared.cc | 4 +++- src/libmain/shared.hh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libmain') diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index d3b73f8fd5a3..99ac198ca356 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -287,7 +287,7 @@ static void * oomHandler(size_t requested) int exitCode = 0; - +char * * argvSaved = 0; } @@ -298,6 +298,8 @@ int main(int argc, char * * argv) { using namespace nix; + argvSaved = argv; + /* If we're setuid, then we need to take some security precautions right away. */ if (argc == 0) abort(); diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh index 1d6a6ec5737d..43725e07fdd9 100644 --- a/src/libmain/shared.hh +++ b/src/libmain/shared.hh @@ -56,6 +56,8 @@ struct RemoveTempRoots /* Exit code of the program. */ extern int exitCode; +extern char * * argvSaved; + } -- cgit 1.4.1