summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 21:36:17 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 21:36:17 +0000
commitac39c526b5e6fc462bade4ef9d76d0a4b3ee437e (patch)
tree1e8e9cfc674dbfea49839d3141df2621e26c3aa2
parent5c9cdc459e39c935701616c236bb7ad5061c41ee (diff)
downloadchromium_src-ac39c526b5e6fc462bade4ef9d76d0a4b3ee437e.zip
chromium_src-ac39c526b5e6fc462bade4ef9d76d0a4b3ee437e.tar.gz
chromium_src-ac39c526b5e6fc462bade4ef9d76d0a4b3ee437e.tar.bz2
Linux: fail more gracefully when ProcessSingleton fails to bind.
For users with AFS home directories, we cannot create UNIX domain sockets for ProcessSingleton. Before this patch we would spin because the socket would be constantly 'readable' for accept. http://codereview.chromium.org/139008 BUG=14237 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19178 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/process_singleton_linux.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc
index 80149d1..eebbd39 100644
--- a/chrome/browser/process_singleton_linux.cc
+++ b/chrome/browser/process_singleton_linux.cc
@@ -397,8 +397,15 @@ void ProcessSingleton::Create() {
if (unlink(socket_path_.value().c_str()) < 0)
DCHECK_EQ(errno, ENOENT);
- if (bind(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) < 0)
+ if (bind(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) < 0) {
LOG(ERROR) << "bind() failed: " << strerror(errno);
+ LOG(ERROR) << "SingletonSocket failed to create a socket in your home "
+ "directory. This means that running multiple instances of "
+ "the Chrome binary will start multiple browser process "
+ "rather than opening a new window in the existing process.";
+ close(sock);
+ return;
+ }
if (listen(sock, 5) < 0)
NOTREACHED() << "listen failed: " << strerror(errno);