Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: content/common/set_process_title.cc

Issue 8341052: share all the needed linux code with OpenBSD in chrome and content (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/set_process_title.h" 5 #include "content/common/set_process_title.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 12
13 #if defined(OS_POSIX) 13 #if defined(OS_POSIX)
14 #include <limits.h> 14 #include <limits.h>
15 #include <stdlib.h> 15 #include <stdlib.h>
16 #include <unistd.h> 16 #include <unistd.h>
17 #endif 17 #endif
18 18
19 #if defined(OS_LINUX) 19 #if defined(OS_LINUX)
20 #include <sys/prctl.h> 20 #include <sys/prctl.h>
21 21
22 // Linux/glibc doesn't natively have setproctitle(). 22 // Linux/glibc doesn't natively have setproctitle().
23 #include "content/common/set_process_title_linux.h" 23 #include "content/common/set_process_title_linux.h"
24 #endif 24 #endif
25 25
26 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS) 26 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS) && \
27 defined(OS_OPENBSD)
27 28
28 void SetProcessTitleFromCommandLine(const char** main_argv) { 29 void SetProcessTitleFromCommandLine(const char** main_argv) {
29 // Build a single string which consists of all the arguments separated 30 // Build a single string which consists of all the arguments separated
30 // by spaces. We can't actually keep them separate due to the way the 31 // by spaces. We can't actually keep them separate due to the way the
31 // setproctitle() function works. 32 // setproctitle() function works.
32 std::string title; 33 std::string title;
33 bool have_argv0 = false; 34 bool have_argv0 = false;
34 35
35 #if defined(OS_LINUX) 36 #if defined(OS_LINUX)
36 if (main_argv) 37 if (main_argv)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 73
73 #else 74 #else
74 75
75 // All other systems (basically Windows & Mac) have no need or way to implement 76 // All other systems (basically Windows & Mac) have no need or way to implement
76 // this function. 77 // this function.
77 void SetProcessTitleFromCommandLine(const char** /* main_argv */) { 78 void SetProcessTitleFromCommandLine(const char** /* main_argv */) {
78 } 79 }
79 80
80 #endif 81 #endif
81 82
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698