Navigation Menu

Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
process: fix process.title setter
Browse files Browse the repository at this point in the history
Commit 19fd530 broke the argv initialization logic that's used on linux and
freebsd to update the process name (as displayed in tools like `top`).

Fixes test/simple/test-setproctitle.js.
  • Loading branch information
bnoordhuis committed Mar 15, 2012
1 parent 702b46c commit 1a97998
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node.cc
Expand Up @@ -2624,9 +2624,6 @@ char** Init(int argc, char *argv[]) {
// Initialize prog_start_time to get relative uptime.
uv_uptime(&prog_start_time);

// Hack aroung with the argv pointer. Used for process.title = "blah".
argv = uv_setup_args(argc, argv);

// Parse a few arguments which are specific to Node.
node::ParseArgs(argc, argv);
// Parse the rest of the args (up to the 'option_end_index' (where '--' was
Expand Down Expand Up @@ -2754,6 +2751,9 @@ static char **copy_argv(int argc, char **argv) {
}

int Start(int argc, char *argv[]) {
// Hack aroung with the argv pointer. Used for process.title = "blah".
argv = uv_setup_args(argc, argv);

// Logic to duplicate argv as Init() modifies arguments
// that are passed into it.
char **argv_copy = copy_argv(argc, argv);
Expand Down

0 comments on commit 1a97998

Please sign in to comment.