Commit 73e043e0 authored by thestig@chromium.org's avatar thestig@chromium.org

Linux: Fix bad #define for SetProcessTitleFromCommandLine().

BUG=104580
TEST=see bug
Review URL: http://codereview.chromium.org/8598004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110759 0039d316-1c4b-4281-b951-d872f2087c98
parent f7521659
......@@ -4,27 +4,29 @@
#include "content/common/set_process_title.h"
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/string_util.h"
#include "build/build_config.h"
#if defined(OS_POSIX)
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS)
#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#endif
#include <string>
#include "base/command_line.h"
#endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS)
#if defined(OS_LINUX)
#include <sys/prctl.h>
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/string_util.h"
// Linux/glibc doesn't natively have setproctitle().
#include "content/common/set_process_title_linux.h"
#endif
#endif // defined(OS_LINUX)
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS) && \
defined(OS_OPENBSD)
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS)
void SetProcessTitleFromCommandLine(const char** main_argv) {
// Build a single string which consists of all the arguments separated
......@@ -57,9 +59,9 @@ void SetProcessTitleFromCommandLine(const char** main_argv) {
// available, this lets us set the short process name that shows when the
// full command line is not being displayed in most process listings.
prctl(PR_SET_NAME, FilePath(title).BaseName().value().c_str());
#endif
#endif // defined(PR_SET_NAME)
}
#endif
#endif // defined(OS_LINUX)
const CommandLine* command_line = CommandLine::ForCurrentProcess();
for (size_t i = 1; i < command_line->argv().size(); ++i) {
......@@ -79,4 +81,3 @@ void SetProcessTitleFromCommandLine(const char** /* main_argv */) {
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment