summaryrefslogtreecommitdiffstats
path: root/chrome/common/service_process_util.cc
diff options
context:
space:
mode:
authorgene@google.com <gene@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 19:09:28 +0000
committergene@google.com <gene@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 19:09:28 +0000
commit1f6f7a7ef5caf289329bfb1b576877f6be55dce7 (patch)
tree56d3349417f7b0d37b75c3df9ab7b8516b00292d /chrome/common/service_process_util.cc
parent8281e48e7ea8f55058a69d4ff26b78a98697ffe9 (diff)
downloadchromium_src-1f6f7a7ef5caf289329bfb1b576877f6be55dce7.zip
chromium_src-1f6f7a7ef5caf289329bfb1b576877f6be55dce7.tar.gz
chromium_src-1f6f7a7ef5caf289329bfb1b576877f6be55dce7.tar.bz2
Fix service for CUPS CP proxy.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3732001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62313 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/service_process_util.cc')
-rw-r--r--chrome/common/service_process_util.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc
index 7eb6f71..d0c2793 100644
--- a/chrome/common/service_process_util.cc
+++ b/chrome/common/service_process_util.cc
@@ -46,6 +46,7 @@ std::string GetServiceProcessScopedName(const std::string& append_str) {
std::string scoped_name = user_data_dir.value();
#endif // defined(OS_WIN)
std::replace(scoped_name.begin(), scoped_name.end(), '\\', '!');
+ std::replace(scoped_name.begin(), scoped_name.end(), '/', '!');
scoped_name.append(append_str);
return scoped_name;
}
@@ -214,6 +215,11 @@ std::string GetServiceProcessAutoRunKey() {
bool TakeServiceProcessSingletonLock() {
DCHECK(g_service_globals == NULL);
+ // On Linux shared menory is implemented using file. In case of incorrect
+ // shutdown or process kill memshared file stay on the disk and prevents
+ // next instance of service from starting. So, on Linux we have to disable
+ // check for another running instance of the service.
+#if defined(OS_WIN)
std::string running_version;
ServiceProcessRunningState state =
GetServiceProcessRunningState(&running_version);
@@ -228,6 +234,7 @@ bool TakeServiceProcessSingletonLock() {
case SERVICE_NOT_RUNNING:
break;
}
+#endif
g_service_globals = new ServiceProcessGlobalState;
// TODO(sanjeevr): We can probably use the shared mem as the sole singleton
// mechanism. For that the shared mem class needs to return whether it created