aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-sync_util_get__session__name__linux.cc
blob: 0cfde4554c97f8e37dfb42517912af7ab9cac85b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- sync/util/get_session_name_linux.cc.orig	2016-03-25 13:04:51 UTC
+++ sync/util/get_session_name_linux.cc
@@ -13,8 +13,9 @@ namespace syncer {
 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();
 }