aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-sync__util__get_session_name_linux.cc
blob: 4f7f5de68fb50d058a10cb7e2d30b80a1e3b2dfa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- sync/util/get_session_name_linux.cc.orig	2014-10-10 08:54:17 UTC
+++ sync/util/get_session_name_linux.cc
@@ -13,8 +13,9 @@
 namespace internal {
 
 std::string GetHostname() {
-  char hostname[HOST_NAME_MAX];
-  if (gethostname(hostname, HOST_NAME_MAX) == 0)  // Success.
+  int len = sysconf(_SC_HOST_NAME_MAX);
+  char hostname[len];
+  if (gethostname(hostname, len) == 0)  // Success.
     return hostname;
   return base::GetLinuxDistro();
 }