Chromium Code Reviews| Index: content/common/set_process_title.cc |
| =================================================================== |
| --- content/common/set_process_title.cc (revision 163359) |
| +++ content/common/set_process_title.cc (working copy) |
| @@ -23,24 +23,26 @@ |
| #include "base/file_util.h" |
| #include "base/process_util.h" |
| #include "base/string_util.h" |
| -// Linux/glibc doesn't natively have setproctitle(). |
| +// Linux/glibc doesn't natively have SetProcTitle(). |
| #include "content/common/set_process_title_linux.h" |
| #endif // defined(OS_LINUX) |
| -// TODO(jrg): Find out if setproctitle or equivalent is available on Android. |
| +namespace content { |
| + |
| +// TODO(jrg): Find out if SetProcTitle or equivalent is available on Android. |
| #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS) && \ |
| !defined(OS_ANDROID) |
| void SetProcessTitleFromCommandLine(const char** main_argv) { |
| // Build a single string which consists of all the arguments separated |
| // by spaces. We can't actually keep them separate due to the way the |
| - // setproctitle() function works. |
| + // SetProcTitle() function works. |
| std::string title; |
| bool have_argv0 = false; |
| #if defined(OS_LINUX) |
| if (main_argv) |
| - setproctitle_init(main_argv); |
| + SetProcTitleInit(main_argv); |
| // In Linux we sometimes exec ourselves from /proc/self/exe, but this makes us |
| // show up as "exe" in process listings. Read the symlink /proc/self/exe and |
| @@ -73,7 +75,7 @@ |
| title += command_line->argv()[i]; |
| } |
| // Disable prepending argv[0] with '-' if we prepended it ourselves above. |
| - setproctitle(have_argv0 ? "-%s" : "%s", title.c_str()); |
| + SetProcTitle(have_argv0 ? "-%s" : "%s", title.c_str()); |
|
scottmg
2012/10/22 23:42:19
this rename will break on other posix != linux? no
|
| } |
| #else |
| @@ -84,3 +86,5 @@ |
| } |
| #endif |
| + |
| +} // namespace content |